@effect/platform-node-shared
Advanced tools
Comparing version
@@ -116,3 +116,4 @@ "use strict"; | ||
return (path, options) => nodeRm(path, { | ||
recursive: options?.recursive ?? false | ||
recursive: options?.recursive ?? false, | ||
force: options?.force ?? false | ||
}); | ||
@@ -257,6 +258,6 @@ }; | ||
// == readDirectory | ||
const readDirectory = /*#__PURE__*/(() => { | ||
const nodeReadDirectory = /*#__PURE__*/(0, _Effectify.effectify)(NFS.readdir, /*#__PURE__*/(0, _error.handleErrnoException)("FileSystem", "readDirectory"), /*#__PURE__*/handleBadArgument("readDirectory")); | ||
return (path, options) => nodeReadDirectory(path, options); | ||
})(); | ||
const readDirectory = (path, options) => Effect.tryPromise({ | ||
try: () => NFS.promises.readdir(path, options), | ||
catch: err => (0, _error.handleErrnoException)("FileSystem", "readDirectory")(err, [path]) | ||
}); | ||
// == readFile | ||
@@ -263,0 +264,0 @@ const readFile = path => Effect.async((resume, signal) => { |
@@ -85,3 +85,4 @@ import { effectify } from "@effect/platform/Effectify"; | ||
return (path, options) => nodeRm(path, { | ||
recursive: options?.recursive ?? false | ||
recursive: options?.recursive ?? false, | ||
force: options?.force ?? false | ||
}); | ||
@@ -226,6 +227,6 @@ }; | ||
// == readDirectory | ||
const readDirectory = /*#__PURE__*/(() => { | ||
const nodeReadDirectory = /*#__PURE__*/effectify(NFS.readdir, /*#__PURE__*/handleErrnoException("FileSystem", "readDirectory"), /*#__PURE__*/handleBadArgument("readDirectory")); | ||
return (path, options) => nodeReadDirectory(path, options); | ||
})(); | ||
const readDirectory = (path, options) => Effect.tryPromise({ | ||
try: () => NFS.promises.readdir(path, options), | ||
catch: err => handleErrnoException("FileSystem", "readDirectory")(err, [path]) | ||
}); | ||
// == readFile | ||
@@ -232,0 +233,0 @@ const readFile = path => Effect.async((resume, signal) => { |
{ | ||
"name": "@effect/platform-node-shared", | ||
"version": "0.3.23", | ||
"version": "0.3.24", | ||
"description": "Unified interfaces for common platform-specific services", | ||
@@ -17,4 +17,4 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@effect/platform": "^0.48.23", | ||
"effect": "^2.4.16" | ||
"@effect/platform": "^0.48.24", | ||
"effect": "^2.4.17" | ||
}, | ||
@@ -21,0 +21,0 @@ "exports": { |
@@ -150,3 +150,3 @@ import { effectify } from "@effect/platform/Effectify" | ||
path, | ||
{ recursive: options?.recursive ?? false } | ||
{ recursive: options?.recursive ?? false, force: options?.force ?? false } | ||
) | ||
@@ -395,13 +395,8 @@ } | ||
const readDirectory = (() => { | ||
const nodeReadDirectory = effectify( | ||
NFS.readdir, | ||
handleErrnoException("FileSystem", "readDirectory"), | ||
handleBadArgument("readDirectory") | ||
) | ||
const readDirectory = (path: string, options?: FileSystem.ReadDirectoryOptions) => | ||
Effect.tryPromise({ | ||
try: () => NFS.promises.readdir(path, options), | ||
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err as any, [path]) | ||
}) | ||
return (path: string, options?: FileSystem.ReadDirectoryOptions) => | ||
nodeReadDirectory(path, options) as Effect.Effect<ReadonlyArray<string>, Error.PlatformError> | ||
})() | ||
// == readFile | ||
@@ -408,0 +403,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
383835
-0.04%5824
-0.03%