( schema: S, options?: SchemaAST.ParseOptions )
| 2217 | * @since 3.10.0 |
| 2218 | */ |
| 2219 | export function encodeUnknownPromise<S extends ConstraintEncoder<unknown>>( |
| 2220 | schema: S, |
| 2221 | options?: SchemaAST.ParseOptions |
| 2222 | ) { |
| 2223 | const parser = encodeUnknownEffect(schema, options) |
| 2224 | return (input: unknown, options?: SchemaAST.ParseOptions): Promise<S["Encoded"]> => { |
| 2225 | return runSchemaErrorPromise(parser(input, options)) |
| 2226 | } |
| 2227 | } |
| 2228 | /** |
| 2229 | * Encodes a typed input (the schema's `Type`) against a schema, returning a |
| 2230 | * `Promise` that resolves with the encoded value or rejects with a |
no test coverage detected