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

Function OptionFromNullishOr

packages/effect/src/Schema.ts:9775–9785  ·  view source on GitHub ↗
(
  schema: S,
  options?: {
    onNoneEncoding: null | undefined
  }
)

Source from the content-addressed store, hash-verified

9773 * @since 3.10.0
9774 */
9775export function OptionFromNullishOr<S extends Constraint>(
9776 schema: S,
9777 options?: {
9778 onNoneEncoding: null | undefined
9779 }
9780): OptionFromNullishOr<S> {
9781 return NullishOr(schema).pipe(decodeTo(
9782 Option(toType(schema)),
9783 SchemaTransformation.optionFromNullishOr(options)
9784 ))
9785}
9786
9787/**
9788 * Type-level representation returned by {@link OptionFromOptionalKey}.

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected