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

Function encodeUnknownEffect

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

Source from the content-addressed store, hash-verified

1974 * @since 4.0.0
1975 */
1976export function encodeUnknownEffect<S extends Constraint>(schema: S, options?: SchemaAST.ParseOptions) {
1977 const parser = SchemaParser.encodeUnknownEffect(schema, options)
1978 return (
1979 input: unknown,
1980 options?: SchemaAST.ParseOptions
1981 ): Effect.Effect<S["Encoded"], SchemaError, S["EncodingServices"]> => {
1982 return fromIssueEffect(parser(input, options))
1983 }
1984}
1985
1986/**
1987 * Encodes a typed input (the schema's `Type`) against a schema, returning an

Callers 2

encodeUnknownPromiseFunction · 0.70
encodeUnknownSyncFunction · 0.70

Calls 1

fromIssueEffectFunction · 0.85

Tested by

no test coverage detected