Decoding a nullable string to a non-nullable string with a default value
I want to decode property
description: string | null
description: string | null
to become
description: string
description: string
when decoded (with a default value "No description available". Is this possible somehow (without needing to bust out a whole transform schema?? Here's what I tried;
const Schema = S.Struct({ description: S.optionalWith(S.NullOr(S.String), { default: () => "No description provided", nullable: true }),})// the above results in `description: string | null`
const Schema = S.Struct({ description: S.optionalWith(S.NullOr(S.String), { default: () => "No description provided", nullable: true }),})// the above results in `description: string | null`