@pengzhanbo/utils - v3.7.3
    Preparing search index...

    Function isEmpty

    • Checks if a value is empty.

      检查值是否为空。

      Parameters

      • v: unknown

        The value to check. 要检查的值

      Returns boolean

      True if the value is empty, false otherwise. 如果值为空则返回 true,否则返回 false

      • For strings, arrays, buffers, and typed arrays: "empty" means a length of 0.

      • For Map and Set: "empty" means a size of 0.

      • Nil values (null / undefined) are considered empty.

      • For plain objects: delegates to isEmptyObject, which uses for...in and therefore skips Symbol-keyed properties.

      • 对于字符串、数组、缓冲区和类型化数组:"空"表示长度为 0

      • 对于 Map 和 Set:"空"表示大小为 0

      • 空值(null / undefined)被视为空。

      • 对于普通对象:委托给 isEmptyObject,该方法使用 for...in,因此会跳过 Symbol 键属性。

      isEmpty('') // => true
      isEmpty([]) // => true
      isEmpty(new Map()) // => true
      isEmpty({ a: 1 }) // => false