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

Function encodeUnknownResult

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

Source from the content-addressed store, hash-verified

2150 * @since 4.0.0
2151 */
2152export function encodeUnknownResult<S extends ConstraintEncoder<unknown>>(schema: S, options?: SchemaAST.ParseOptions) {
2153 const parser = SchemaParser.encodeUnknownResult(schema, options)
2154 return (input: unknown, options?: SchemaAST.ParseOptions): Result_.Result<S["Encoded"], SchemaError> => {
2155 return Result_.mapError(parser(input, options), (issue) => new SchemaError(issue))
2156 }
2157}
2158/**
2159 * Encodes a typed input (the schema's `Type`) against a schema, returning a
2160 * `Result` that succeeds with the encoded value or fails with a

Callers 1

Schema.test.tsFile · 0.50

Calls 1

parserFunction · 0.70

Tested by

no test coverage detected