@@ -97,6 +97,8 @@ const {
9797 kEmptyObject,
9898 lazyDOMException,
9999 promisify,
100+ isWindows,
101+ isMacOS,
100102} = require ( 'internal/util' ) ;
101103const EventEmitter = require ( 'events' ) ;
102104const { StringDecoder } = require ( 'string_decoder' ) ;
@@ -126,9 +128,6 @@ const {
126128const getDirectoryEntriesPromise = promisify ( getDirents ) ;
127129const validateRmOptionsPromise = promisify ( validateRmOptions ) ;
128130
129- const isWindows = process . platform === 'win32' ;
130- const isOSX = process . platform === 'darwin' ;
131-
132131let cpPromises ;
133132function lazyLoadCpPromises ( ) {
134133 return cpPromises ??= require ( 'internal/fs/cp/cp' ) . cpFn ;
@@ -1256,7 +1255,7 @@ async function* _watch(filename, options = kEmptyObject) {
12561255 // TODO(anonrig): Remove non-native watcher when/if libuv supports recursive.
12571256 // As of November 2022, libuv does not support recursive file watch on all platforms,
12581257 // e.g. Linux due to the limitations of inotify.
1259- if ( options . recursive && ! isOSX && ! isWindows ) {
1258+ if ( options . recursive && ! isMacOS && ! isWindows ) {
12601259 const watcher = new nonNativeWatcher . FSWatcher ( options ) ;
12611260 watcher [ kFSWatchStart ] ( filename ) ;
12621261 yield * watcher ;
@@ -1306,7 +1305,7 @@ module.exports = {
13061305 writeFile,
13071306 appendFile,
13081307 readFile,
1309- watch : ! isOSX && ! isWindows ? _watch : watch ,
1308+ watch : ! isMacOS && ! isWindows ? _watch : watch ,
13101309 constants,
13111310 } ,
13121311
0 commit comments