Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@techor/is-plain-obj

techor-dev732MIT3.2.5TypeScript support: included

Is it a plain object?

object, is-plain-object, utils

readme


Is it a plain object? ~100B

<picture> <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/badge/%E2%AC%85%20back-%20?color=212022&style=for-the-badge"> <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/badge/%E2%AC%85%20back-%20?color=f6f7f8&style=for-the-badge"> NPM Version </picture> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/v/release/techor-dev/techor?include_prereleases&color=212022&label=&style=for-the-badge&logo=github&logoColor=fff"> <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/v/release/techor-dev/techor?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github&logoColor=%23000"> NPM Version </picture> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/is-plain-obj?color=212022&label=%20&logo=npm&style=for-the-badge"> <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/npm/dm/is-plain-obj?color=f6f7f8&label=%20&logo=npm&style=for-the-badge"> NPM package ( download / month ) </picture> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=212022&logo=twitter&style=for-the-badge"> <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge"> Follow @mastercorg </picture> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/techor-dev/techor/release.yml?branch=main&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge"> <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/techor-dev/techor/release.yml?branch=main&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000"> Github release actions </picture>


Getting Started

npm install @techor/is-plain-obj

Usage

import aPlainObj from '@techor/is-plain-obj'

aPlainObj({})
// true

Overview

// true
aPlainObj(Object.create({}))
aPlainObj(Object.create(Object.prototype))
aPlainObj({ foo: 'bar' })
aPlainObj({})
aPlainObj(Object.create(null))

// false
function Foo() { this.abc = {} }
aPlainObj(/foo/)
aPlainObj(function () { })
aPlainObj(1)
aPlainObj(['foo', 'bar'])
aPlainObj([])
aPlainObj(new Foo)
aPlainObj(null)
aPlainObj(undefined)

<picture> <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/badge/%E2%AC%85%20back%20to%20contents-%20?color=212022&style=for-the-badge"> <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/badge/%E2%AC%85%20back%20to%20contents-%20?color=f6f7f8&style=for-the-badge"> NPM Version </picture>