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

Function removeFactory

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

Source from the content-addressed store, hash-verified

105const makeTempDirectory = makeTempDirectoryFactory("makeTempDirectory")
106
107const removeFactory = (method: string): FileSystem.FileSystem["remove"] => (path, options) => {
108 const effect = tryPromise(method, path, () => Deno.remove(path, { recursive: options?.recursive ?? false }))
109 return options?.force
110 ? Effect.catchTag(
111 effect,
112 "PlatformError",
113 (error) => error.reason._tag === "NotFound" ? Effect.void : Effect.fail(error)
114 )
115 : effect
116}
117
118const remove = removeFactory("remove")
119

Callers 3

DenoFileSystem.tsFile · 0.70
makeTempDirectoryScopedFunction · 0.70
makeTempFileScopedFunction · 0.70

Calls 3

tryPromiseFunction · 0.70
removeMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected