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

Function encodeUnknownResult

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

Source from the content-addressed store, hash-verified

2174 * @since 4.0.0
2175 */
2176export function encodeUnknownResult<S extends ConstraintEncoder<unknown>>(schema: S, options?: SchemaAST.ParseOptions) {
2177 const parser = SchemaParser.encodeUnknownResult(schema, options)
2178 return (input: unknown, options?: SchemaAST.ParseOptions): Result_.Result<S["Encoded"], SchemaError> => {
2179 return Result_.mapError(parser(input, options), (issue) => new SchemaError(issue))
2180 }
2181}
2182
2183/**
2184 * Encodes a typed input (the schema's `Type`) against a schema, returning a

Callers 1

Schema.test.tsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected