@file-services/node
Advanced tools
Comparing version 9.3.0 to 9.3.1
{ | ||
"name": "@file-services/node", | ||
"description": "Node.js file system implementation.", | ||
"version": "9.3.0", | ||
"version": "9.3.1", | ||
"main": "./dist/fs-node.cjs", | ||
@@ -20,4 +20,4 @@ "types": "./dist/index.d.ts", | ||
"dependencies": { | ||
"@file-services/types": "^9.3.0", | ||
"@file-services/utils": "^9.3.0" | ||
"@file-services/types": "^9.3.1", | ||
"@file-services/utils": "^9.3.1" | ||
}, | ||
@@ -24,0 +24,0 @@ "files": [ |
@@ -6,5 +6,6 @@ import fs from "node:fs"; | ||
import type { IBaseFileSystem, IFileSystem } from "@file-services/types"; | ||
import type { IBaseFileSystem, IFileSystem, WatchOptions } from "@file-services/types"; | ||
import { createFileSystem } from "@file-services/utils"; | ||
import { INodeWatchServiceOptions, NodeWatchService } from "./watch-service"; | ||
import { RecursiveFSWatcher } from "./recursive-fs-watcher"; | ||
@@ -23,2 +24,4 @@ const caseSensitive = !fs.existsSync(argv[0]!.toUpperCase()); | ||
export function createBaseNodeFs(options?: ICreateNodeFsOptions): IBaseFileSystem { | ||
const originalWatch = fs.watch; | ||
const watch = process.platform === "linux" ? wrapWithOwnRecursiveImpl(originalWatch) : originalWatch; | ||
return { | ||
@@ -31,2 +34,3 @@ ...path, | ||
...fs, | ||
watch, | ||
promises: { | ||
@@ -38,1 +42,10 @@ ...fs.promises, | ||
} | ||
function wrapWithOwnRecursiveImpl(originalWatch: typeof fs.watch) { | ||
return (targetPath: string, options?: WatchOptions) => { | ||
if (options?.recursive) { | ||
return new RecursiveFSWatcher(targetPath, options); | ||
} | ||
return originalWatch(targetPath, options); | ||
}; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79457
19
1035
Updated@file-services/types@^9.3.1
Updated@file-services/utils@^9.3.1