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 accepts null and becomes optional (T | null | undefined).
true
null
T | null | undefined
The primitive type — "string", "number", or "boolean".
A schema field definition for a primitive type (
"string","number", or"boolean").Example