refactor(schema): tighten public contracts (#33771)
This commit is contained in:
@@ -11,7 +11,7 @@ export type AbsolutePath = typeof AbsolutePath.Type
|
||||
|
||||
export const optional = <S extends Schema.Top>(schema: S) =>
|
||||
Schema.optionalKey(schema).pipe(
|
||||
Schema.decodeTo(Schema.optional(schema), {
|
||||
Schema.decodeTo(Schema.optional(Schema.toType(schema)), {
|
||||
decode: SchemaGetter.passthrough({ strict: false }),
|
||||
encode: SchemaGetter.transformOptional(Option.filter((value) => value !== undefined)),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user