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

Function OptionFromOptional

packages/effect/src/Schema.ts:9838–9843  ·  view source on GitHub ↗
(schema: S)

Source from the content-addressed store, hash-verified

9836 * @since 4.0.0
9837 */
9838export function OptionFromOptional<S extends Constraint>(schema: S): OptionFromOptional<S> {
9839 return optional(schema).pipe(decodeTo(
9840 Option(toType(schema)),
9841 SchemaTransformation.optionFromOptional<any>()
9842 ))
9843}
9844
9845/**
9846 * Type-level representation returned by {@link OptionFromOptionalNullOr}.

Callers

nothing calls this directly

Calls 5

toTypeInterface · 0.85
optionalInterface · 0.70
decodeToFunction · 0.70
OptionFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected