Converting Schema.rename() in a Class-Based Schema
Hi there.
How would "convert" the Schema.rename() in a class based schema:
How would "convert" the Schema.rename() in a class based schema:
const PersonSchema = SCH.Struct({
full_name: SCH.NonEmptyString,
age: SCH.NumberFromString,
country_of_origin: SCH.Union(
SCH.Literal("SVK"),
SCH.Union(SCH.Literal("GBR"), SCH.Literal("UK")),
SCH.Literal("USA")
),
user_id: SCH.UUID,
timestamp: SCH.DateFromNumber
}).pipe(
SCH.rename({
full_name: "name",
country_of_origin: "country",
user_id: "id"
})
)