@vsokolov/utils - v0.32.0
    Preparing search index...

    Function isPlainObject

    • Check if a value is a plain object (created by {} or new Object()) Returns false for arrays, Date, RegExp, Map, Set, class instances, etc.

      Parameters

      • val: unknown

        The value to check

      Returns val is Record<string, unknown>

      True if the value is a plain object

      isPlainObject({}) // true
      isPlainObject({ a: 1 }) // true
      isPlainObject([]) // false
      isPlainObject(new Date()) // false
      isPlainObject(null) // false
      isPlainObject(class Foo {}) // false