MCPcopy Create free account
hub / github.com/Effect-TS/effect / removeFactory

Function removeFactory

packages/platform/deno/src/DenoFileSystem.ts:99–108  ·  view source on GitHub ↗
(method: string)

Source from the content-addressed store, hash-verified

97const makeTempDirectory = makeTempDirectoryFactory("makeTempDirectory")
98
99const removeFactory = (method: string): FileSystem.FileSystem["remove"] => (path, options) => {
100 const effect = tryPromise(method, path, () => Deno.remove(path, { recursive: options?.recursive ?? false }))
101 return options?.force
102 ? Effect.catchTag(
103 effect,
104 "PlatformError",
105 (error) => error.reason._tag === "NotFound" ? Effect.void : Effect.fail(error)
106 )
107 : effect
108}
109
110const remove = removeFactory("remove")
111

Callers 3

DenoFileSystem.tsFile · 0.70
makeTempDirectoryScopedFunction · 0.70
makeTempFileScopedFunction · 0.70

Calls 3

tryPromiseFunction · 0.70
removeMethod · 0.65
failMethod · 0.65

Tested by

no test coverage detected