Understanding the `optionFromNullable` Combinator in `@effect/schema`
Been loving
However, the following give me an error:
Here's the tsplay link https://www.typescriptlang.org/play?noUncheckedIndexedAccess=true&experimentalDecorators=true&emitDecoratorMetadata=true&exactOptionalPropertyTypes=true&noImplicitOverride=true&noPropertyAccessFromIndexSignature=true&noFallthroughCasesInSwitch=true&useUnknownInCatchVariables=true#code/JYWwDg9gTgLgBAKjgQwM5wMpwGZQiOAIgAEBTbbUgYxgHpUqALUkZWjJl5QgbgCg+VCADtU8Bs1ZwAvJgB0YqAFcaACgDefOHGFKANnuQAjPaQwwowYQHMAXPIhgYwEQDE8IAHL7DJ0qowFCytrAEoAGj4AX1C+KxhSKGxkKlI4d3w4UgAPBOEAE3RAjklkOQyQAB4YAE8wUghsOAkuAD44dTgogXzqQyg0oVF4XHx7Cv5RkDldA2NTc0sbPlpabQA9AH4Vtbh1uHyIUlRhAHJ4Kyo9JV64AAMlAvIrUny7gUERMTgwZChUUgAVSe2Be+Rk8l+-zMNWEVFULVYoQ0O20G22qzRezgAHdoABrdA45jCH5-VAhLQ6HzzMzBGz2R69UHCV7RWKfYYHagQXrA5lgiGBXpCXoYWHwxHIZGabSzXwLel2OBM56s-JUzH7RJ4KD2QgAFTqaVOqpZr1OcGA6GEEHgaAp1mEtLgMAgruNcFOihCcAAPtSDKc5KoAEwAZlDodChEI7KAA
I've made sure that
tl;dr, is there a combinator to parse and decode
@effect/schema so far, however I'm slightly confused by the input to the optionFromNullable combinator. The docs say that Theoptioncombinator in@effect/schema/Schemaallows you to specify that a field in a schema is of typeOption<A>and can be parsed from a required nullable fieldA | undefined | null.
However, the following give me an error:
Here's the tsplay link https://www.typescriptlang.org/play?noUncheckedIndexedAccess=true&experimentalDecorators=true&emitDecoratorMetadata=true&exactOptionalPropertyTypes=true&noImplicitOverride=true&noPropertyAccessFromIndexSignature=true&noFallthroughCasesInSwitch=true&useUnknownInCatchVariables=true#code/JYWwDg9gTgLgBAKjgQwM5wMpwGZQiOAIgAEBTbbUgYxgHpUqALUkZWjJl5QgbgCg+VCADtU8Bs1ZwAvJgB0YqAFcaACgDefOHGFKANnuQAjPaQwwowYQHMAXPIhgYwEQDE8IAHL7DJ0qowFCytrAEoAGj4AX1C+KxhSKGxkKlI4d3w4UgAPBOEAE3RAjklkOQyQAB4YAE8wUghsOAkuAD44dTgogXzqQyg0oVF4XHx7Cv5RkDldA2NTc0sbPlpabQA9AH4Vtbh1uHyIUlRhAHJ4Kyo9JV64AAMlAvIrUny7gUERMTgwZChUUgAVSe2Be+Rk8l+-zMNWEVFULVYoQ0O20G22qzRezgAHdoABrdA45jCH5-VAhLQ6HzzMzBGz2R69UHCV7RWKfYYHagQXrA5lgiGBXpCXoYWHwxHIZGabSzXwLel2OBM56s-JUzH7RJ4KD2QgAFTqaVOqpZr1OcGA6GEEHgaAp1mEtLgMAgruNcFOihCcAAPtSDKc5KoAEwAZlDodChEI7KAA
I've made sure that
strict and exactOptionalPropertyTypes are enabled.tl;dr, is there a combinator to parse and decode
A | undefined | null into Option<A>?