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

Function encodeUnknownExit

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

Source from the content-addressed store, hash-verified

2018 * @since 4.0.0
2019 */
2020export function encodeUnknownExit<S extends ConstraintEncoder<unknown>>(schema: S, options?: SchemaAST.ParseOptions) {
2021 const parser = SchemaParser.encodeUnknownExit(schema, options)
2022 return (input: unknown, options?: SchemaAST.ParseOptions): Exit_.Exit<S["Encoded"], SchemaError> => {
2023 return fromIssueExit(parser(input, options))
2024 }
2025}
2026/**
2027 * Encodes a typed input (the schema's `Type`) against a schema synchronously,
2028 * returning an `Exit` that is either a `Success` with the encoded value or a

Callers

nothing calls this directly

Calls 2

fromIssueExitFunction · 0.85
parserFunction · 0.70

Tested by

no test coverage detected