For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/predicate/isEmpty.md.

isEmpty

Checks if a value is empty.

  • Strings: ''
  • Arrays: length === 0
  • Maps/Sets: size === 0
  • Objects: no own enumerable keys
isEmpty('') // true
isEmpty([]) // true
isEmpty({}) // true
isEmpty(new Map()) // true

Usage

isEmpty(value: string | object)

Checks if a value is empty.

  • Strings: ''
  • Arrays: length === 0
  • Maps/Sets: size === 0
  • Objects: no own enumerable keys
import { isEmpty } from 'massaman'
// or:  import { isEmpty } from 'massaman/predicate'

isEmpty('') // true
isEmpty([]) // true
isEmpty({}) // true
isEmpty(new Map()) // true

Parameters

valuestring | objectrequired

the value to test.

Returns

whether the supported value contains no elements or own enumerable properties.

boolean