Object
Import
TypeScriptimport { isPlainObject } from 'vanilla-jui';
isPlainObject
isPlainObject(value) checks whether a value is a plain object.
- Object literals and
Object.create(null)returntrue. - Arrays, functions, DOM nodes, and class instances return
false.
TypeScriptisPlainObject({ value: 1 }); // trueisPlainObject([]); // falseisPlainObject(new Date()); // false
In schema, use type: 'plainObject', or use plain: true together with type: 'object'.