| 1758 | * @since 4.0.0 |
| 1759 | */ |
| 1760 | export function decodeUnknownResult<S extends ConstraintDecoder<unknown>>(schema: S, options?: SchemaAST.ParseOptions) { |
| 1761 | const parser = SchemaParser.decodeUnknownResult(schema, options) |
| 1762 | return (input: unknown, options?: SchemaAST.ParseOptions): Result_.Result<S["Type"], SchemaError> => { |
| 1763 | return Result_.mapError(parser(input, options), (issue) => new SchemaError(issue)) |
| 1764 | } |
| 1765 | } |
| 1766 | |
| 1767 | /** |
| 1768 | * Decodes a typed input (the schema's `Encoded` type) against a schema, |