@@ -97,6 +97,8 @@ const {
97
97
kEmptyObject,
98
98
lazyDOMException,
99
99
promisify,
100
+ isWindows,
101
+ isMacOS,
100
102
} = require ( 'internal/util' ) ;
101
103
const EventEmitter = require ( 'events' ) ;
102
104
const { StringDecoder } = require ( 'string_decoder' ) ;
@@ -126,9 +128,6 @@ const {
126
128
const getDirectoryEntriesPromise = promisify ( getDirents ) ;
127
129
const validateRmOptionsPromise = promisify ( validateRmOptions ) ;
128
130
129
- const isWindows = process . platform === 'win32' ;
130
- const isOSX = process . platform === 'darwin' ;
131
-
132
131
let cpPromises ;
133
132
function lazyLoadCpPromises ( ) {
134
133
return cpPromises ??= require ( 'internal/fs/cp/cp' ) . cpFn ;
@@ -1256,7 +1255,7 @@ async function* _watch(filename, options = kEmptyObject) {
1256
1255
// TODO(anonrig): Remove non-native watcher when/if libuv supports recursive.
1257
1256
// As of November 2022, libuv does not support recursive file watch on all platforms,
1258
1257
// e.g. Linux due to the limitations of inotify.
1259
- if ( options . recursive && ! isOSX && ! isWindows ) {
1258
+ if ( options . recursive && ! isMacOS && ! isWindows ) {
1260
1259
const watcher = new nonNativeWatcher . FSWatcher ( options ) ;
1261
1260
watcher [ kFSWatchStart ] ( filename ) ;
1262
1261
yield * watcher ;
@@ -1306,7 +1305,7 @@ module.exports = {
1306
1305
writeFile,
1307
1306
appendFile,
1308
1307
readFile,
1309
- watch : ! isOSX && ! isWindows ? _watch : watch ,
1308
+ watch : ! isMacOS && ! isWindows ? _watch : watch ,
1310
1309
constants,
1311
1310
} ,
1312
1311
0 commit comments