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

Function noFollowFlags

packages/platform/node-shared/src/NodeFileSystem.ts:250–261  ·  view source on GitHub ↗
(method: string, flag: FileSystem.OpenFlag)

Source from the content-addressed store, hash-verified

248
249// Reject unsupported platforms: libuv silently ignores unknown flags on Windows.
250const noFollowFlags = (method: string, flag: FileSystem.OpenFlag) =>
251 Effect.suspend(() => {
252 const { O_NOFOLLOW } = NFS.constants
253 if (process.platform === "win32" || typeof O_NOFOLLOW !== "number" || O_NOFOLLOW === 0) {
254 return Effect.fail(Error.badArgument({
255 module: "FileSystem",
256 method,
257 description: "noFollow is not supported on this platform"
258 }))
259 }
260 return Effect.succeed(openFlagBits(flag) | O_NOFOLLOW)
261 })
262
263const openFactory = (method: string): FileSystem.FileSystem["open"] => {
264 const nodeOpen = effectify(

Callers 1

openFactoryFunction · 0.85

Calls 3

openFlagBitsFunction · 0.85
failMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected