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

Function decodeUnknownPromise

packages/effect/src/Schema.ts:1804–1812  ·  view source on GitHub ↗
(
  schema: S,
  options?: SchemaAST.ParseOptions
)

Source from the content-addressed store, hash-verified

1802 * @since 3.10.0
1803 */
1804export function decodeUnknownPromise<S extends ConstraintDecoder<unknown>>(
1805 schema: S,
1806 options?: SchemaAST.ParseOptions
1807) {
1808 const parser = decodeUnknownEffect(schema, options)
1809 return (input: unknown, options?: SchemaAST.ParseOptions): Promise<S["Type"]> => {
1810 return runSchemaErrorPromise(parser(input, options))
1811 }
1812}
1813/**
1814 * Decodes a typed input (the schema's `Encoded` type) against a schema,
1815 * returning a `Promise` that resolves with the decoded value or rejects with a

Callers 1

Schema.test.tsFile · 0.50

Calls 3

runSchemaErrorPromiseFunction · 0.85
decodeUnknownEffectFunction · 0.70
parserFunction · 0.70

Tested by

no test coverage detected