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

Function fileParse

packages/cli/src/internal/options.ts:314–322  ·  view source on GitHub ↗
(
  name: string,
  format?: "json" | "yaml" | "ini" | "toml"
)

Source from the content-addressed store, hash-verified

312
313/** @internal */
314export const fileParse = (
315 name: string,
316 format?: "json" | "yaml" | "ini" | "toml"
317): Options.Options<unknown> =>
318 mapEffect(fileText(name), ([path, content]) =>
319 Effect.mapError(
320 InternalFiles.parse(path, content, format),
321 (error) => InternalValidationError.invalidValue(InternalHelpDoc.p(error))
322 ))
323
324/** @internal */
325export const fileSchema = <I, A>(

Callers 1

fileSchemaFunction · 0.70

Calls 2

parseMethod · 0.80
fileTextFunction · 0.70

Tested by

no test coverage detected