tguard-js
    Preparing search index...

    Function isEmptyObject

    • Determines whether the provided value is an empty plain object.

      Parameters

      • o: unknown

        The value to validate.

      • OptionalincludeHidden: boolean

        Whether to include non-enumerable and symbol properties.

      Returns o is Record<PropertyKey, never>

      true if the value is an empty plain object, false otherwise.

      A value is considered empty if it is a plain object with no own properties.

      By default, only enumerable string-keyed properties are checked. When includeHidden is enabled, all own properties are considered, including non-enumerable and symbol properties.

      For checking an empty array, consider using isEmptyArray.

      Default behavior:

      Value Result
      {} true
      { a: 1 } false
      Object.create(null) true
      [] false
      new Date() false
      { [Symbol('a')]: 1 } true

      With includeHidden set to true:

      Value Result
      {} true
      { [Symbol('a')]: 1 } false
      • This function only checks own properties.
      • Prototype properties are ignored.
      • Arrays are not considered plain objects.

      1.0