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

Function optionFromUndefinedOr

packages/effect/src/SchemaTransformation.ts:1230–1235  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1228 * @since 4.0.0
1229 */
1230export function optionFromUndefinedOr<T>(): Transformation<Option.Option<T>, T | undefined> {
1231 return transform({
1232 decode: Option.fromUndefinedOr,
1233 encode: Option.getOrUndefined
1234 })
1235}
1236
1237/**
1238 * Decodes `T | null | undefined` into `Option<T>` and encodes `Option<T>`

Callers

nothing calls this directly

Calls 1

transformFunction · 0.70

Tested by

no test coverage detected