Checks that assertion passes for each key/value of the object.
const user = object({ name: string, age: number,});user(1); // Error: typeuser(null); // Error: isObjectuser({ name: 1, age: "23",}); // Error: typeuser({ name: "yamiteru", age: 23,}); // passes Copy
const user = object({ name: string, age: number,});user(1); // Error: typeuser(null); // Error: isObjectuser({ name: 1, age: "23",}); // Error: typeuser({ name: "yamiteru", age: 23,}); // passes
Object schema to be checked.
Checks that assertion passes for each key/value of the object.
Example