( value: Value, onNoneEncoding: null | undefined )
| 7274 | * @since 3.10.0 |
| 7275 | */ |
| 7276 | export function OptionFromNullishOr<Value extends Schema.Any>( |
| 7277 | value: Value, |
| 7278 | onNoneEncoding: null | undefined |
| 7279 | ): OptionFromNullishOr<Value> { |
| 7280 | return transform( |
| 7281 | NullishOr(value), |
| 7282 | OptionFromSelf(typeSchema(asSchema(value))), |
| 7283 | { |
| 7284 | strict: true, |
| 7285 | decode: (i) => option_.fromNullable(i), |
| 7286 | encode: onNoneEncoding === null ? |
| 7287 | (a) => option_.getOrNull(a) : |
| 7288 | (a) => option_.getOrUndefined(a) |
| 7289 | } |
| 7290 | ) |
| 7291 | } |
| 7292 | |
| 7293 | /** |
| 7294 | * @category api interface |
nothing calls this directly
no test coverage detected
searching dependent graphs…