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

Function encodeUnknownPromise

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

Source from the content-addressed store, hash-verified

2241 * @since 3.10.0
2242 */
2243export function encodeUnknownPromise<S extends ConstraintEncoder<unknown>>(
2244 schema: S,
2245 options?: SchemaAST.ParseOptions
2246) {
2247 const parser = encodeUnknownEffect(schema, options)
2248 return (input: unknown, options?: SchemaAST.ParseOptions): Promise<S["Encoded"]> => {
2249 return runSchemaErrorPromise(parser(input, options))
2250 }
2251}
2252
2253/**
2254 * Encodes a typed input (the schema's `Type`) against a schema, returning a

Callers 1

Schema.test.tsFile · 0.50

Calls 2

runSchemaErrorPromiseFunction · 0.85
encodeUnknownEffectFunction · 0.70

Tested by

no test coverage detected