* Native recursive `fs.watch` is only reliable on macOS and Windows; on Linux * (and AIX) it throws `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`. We branch on this * to pick the recursive vs per-directory strategy.
()
| 124 | * to pick the recursive vs per-directory strategy. |
| 125 | */ |
| 126 | function supportsRecursiveWatch(): boolean { |
| 127 | return process.platform === 'darwin' || process.platform === 'win32'; |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * Indirection over `fs.watch` so tests can inject a fake that throws or emits |