• Checks if value is an empty object, collection, map, or set.

    Values are considered empty if they are:

    • null or undefined
    • Arrays or strings with length 0
    • Maps or Sets with size 0
    • Objects with no enumerable properties

    Parameters

    • value: unknown

      The value to check.

    Returns boolean

    Returns true if value is empty, else false.

    import { isEmpty } from './AcCmLodashUtils'

    isEmpty(null) // true
    isEmpty(undefined) // true
    isEmpty('') // true
    isEmpty([]) // true
    isEmpty({}) // true
    isEmpty(new Map()) // true
    isEmpty(new Set()) // true
    isEmpty('hello') // false
    isEmpty([1, 2, 3]) // false
    isEmpty({ a: 1 }) // false