Object

Import

TypeScript
import { isPlainObject } from 'vanilla-jui';

isPlainObject

isPlainObject(value) checks whether a value is a plain object.

  • Object literals and Object.create(null) return true.
  • Arrays, functions, DOM nodes, and class instances return false.
TypeScript
isPlainObject({ value: 1 }); // trueisPlainObject([]); // falseisPlainObject(new Date()); // false

In schema, use type: 'plainObject', or use plain: true together with type: 'object'.

Last updated 2026-09-22 16:24:06 UTC+8