S.Struct({
items: S.Record({
key: S.String.pipe(
S.transform(S.String, {
decode: (key) => key.replaceAll(" ", ""),
encode: Function.identity,
strict: true,
}),
S.asSchema
),
value: S.Struct({
quantity: S.NullishOr(S.Int.pipe(S.nonNegative())),
volume: S.NullishOr(S.Int.pipe(S.nonNegative())),
}),
}),
});
error: Uncaught (in promise) Error: Unsupported key schema
schema (Transformation): (string <-> string)
S.Struct({
items: S.Record({
key: S.String.pipe(
S.transform(S.String, {
decode: (key) => key.replaceAll(" ", ""),
encode: Function.identity,
strict: true,
}),
S.asSchema
),
value: S.Struct({
quantity: S.NullishOr(S.Int.pipe(S.nonNegative())),
volume: S.NullishOr(S.Int.pipe(S.nonNegative())),
}),
}),
});
error: Uncaught (in promise) Error: Unsupported key schema
schema (Transformation): (string <-> string)