class Person extends Schema.Class<Person>("Person")({
id: Schema.Number,
name: Schema.NonEmptyString
}) {}
console.log("Encoded Person => ",Schema.encodeUnknownSync(Person)(new Person({id:1, name: "John"})))
// Encoded Person => { id: 1, name: 'John' }
console.log("Encoded Person => ", Schema.encodeUnknownSync(Person)(({id:1, name: "John"})))
// Encoded Person => { id: 1, name: 'John' }
class Person extends Schema.Class<Person>("Person")({
id: Schema.Number,
name: Schema.NonEmptyString
}) {}
console.log("Encoded Person => ",Schema.encodeUnknownSync(Person)(new Person({id:1, name: "John"})))
// Encoded Person => { id: 1, name: 'John' }
console.log("Encoded Person => ", Schema.encodeUnknownSync(Person)(({id:1, name: "John"})))
// Encoded Person => { id: 1, name: 'John' }