MCPcopy Index your code
hub / github.com/Effect-TS/effect / validatePathExistence

Function validatePathExistence

packages/cli/src/internal/primitive.ts:498–510  ·  view source on GitHub ↗
(
  path: string,
  shouldPathExist: Primitive.Primitive.PathExists,
  pathExists: boolean
)

Source from the content-addressed store, hash-verified

496 )
497
498const validatePathExistence = (
499 path: string,
500 shouldPathExist: Primitive.Primitive.PathExists,
501 pathExists: boolean
502): Effect.Effect<void, string> => {
503 if (shouldPathExist === "no" && pathExists) {
504 return Effect.fail(`Path '${path}' must not exist`)
505 }
506 if (shouldPathExist === "yes" && !pathExists) {
507 return Effect.fail(`Path '${path}' must exist`)
508 }
509 return Effect.void
510}
511
512const validatePathType = (
513 path: string,

Callers 1

validateInternalFunction · 0.85

Calls 1

failMethod · 0.65

Tested by

no test coverage detected