(
from: Schema<FA, FI, FR>,
to: Schema<TA, TI, TR>,
options: {
readonly decode: (o: option_.Option<FA>) => option_.Option<TI>
readonly encode: (o: option_.Option<TI>) => option_.Option<FA>
}
)
| 2303 | * @since 3.10.0 |
| 2304 | */ |
| 2305 | export const optionalToOptional = <FA, FI, FR, TA, TI, TR>( |
| 2306 | from: Schema<FA, FI, FR>, |
| 2307 | to: Schema<TA, TI, TR>, |
| 2308 | options: { |
| 2309 | readonly decode: (o: option_.Option<FA>) => option_.Option<TI> |
| 2310 | readonly encode: (o: option_.Option<TI>) => option_.Option<FA> |
| 2311 | } |
| 2312 | ): PropertySignature<"?:", TA, never, "?:", FI, false, FR | TR> => |
| 2313 | makePropertySignature( |
| 2314 | new PropertySignatureTransformation( |
| 2315 | new FromPropertySignature(from.ast, true, true, {}, undefined), |
| 2316 | new ToPropertySignature(to.ast, true, true, {}, undefined), |
| 2317 | options.decode, |
| 2318 | options.encode |
| 2319 | ) |
| 2320 | ) |
| 2321 | |
| 2322 | /** |
| 2323 | * @since 3.10.0 |
no test coverage detected