A schema field definition for a primitive type ("string", "number", or "boolean").
"string"
"number"
"boolean"
const schema = { name: { type: "string" }, age: { type: "number", nullable: true }, active: { type: "boolean" }} as const satisfies ObjectSchema; Copy
const schema = { name: { type: "string" }, age: { type: "number", nullable: true }, active: { type: "boolean" }} as const satisfies ObjectSchema;
Optional
When true, the field becomes optional (T | undefined).
true
T | undefined
The primitive type — "string", "number", or "boolean".
A schema field definition for a primitive type (
"string","number", or"boolean").Example