MCPcopy Create free account
hub / github.com/effect-app/libs / withDefaultParseOptions

Function withDefaultParseOptions

packages/effect-app/src/Schema/ext.ts:76–83  ·  view source on GitHub ↗
(
  decode: Decode,
  defaultParseOptions: SchemaAST.ParseOptions = DefaultParseOptions
)

Source from the content-addressed store, hash-verified

74type DecodeLike = (schema: any) => (input: any, options?: SchemaAST.ParseOptions) => any
75
76export const withDefaultParseOptions = <Decode extends DecodeLike>(
77 decode: Decode,
78 defaultParseOptions: SchemaAST.ParseOptions = DefaultParseOptions
79): Decode =>
80 ((schema: any) => {
81 const run = decode(schema)
82 return (input: any, options?: SchemaAST.ParseOptions) => run(input, { ...defaultParseOptions, ...options })
83 }) as Decode
84
85// TODO: v4 migration - Date is no longer by default encoded to string.
86

Callers 2

Schema.tsFile · 0.90
SchemaParser.tsFile · 0.90

Calls 2

decodeFunction · 0.50
runFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…