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

Function optionFromNullOr

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

Source from the content-addressed store, hash-verified

1186 * @since 4.0.0
1187 */
1188export function optionFromNullOr<T>(): Transformation<Option.Option<T>, T | null> {
1189 return transform({
1190 decode: Option.fromNullOr,
1191 encode: Option.getOrNull
1192 })
1193}
1194
1195/**
1196 * Decodes `T | undefined` into `Option<T>` and encodes `Option.none()` back to

Callers

nothing calls this directly

Calls 1

transformFunction · 0.70

Tested by

no test coverage detected