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