Returns true if the given value is an object created by the Object constructor.
Installations
npm install is-plain-object
Score
99.3
Supply Chain
100
Quality
79.8
Maintenance
100
Vulnerability
100
License
Developer
Developer Guide
Module System
CommonJS, ESM
Min. Node Version
>=0.10.0
Typescript Support
Yes
Node Version
NPM Version
Statistics
151 Stars
51 Commits
30 Forks
8 Watching
1 Branches
8 Contributors
Updated on 18 Nov 2024
Languages
HTML (50.46%)
JavaScript (49.54%)
Total Downloads
Cumulative downloads
Total Downloads
8,547,602,493
Last day
-8.6%
8,968,961
Compared to previous day
Last week
2.4%
53,359,760
Compared to previous week
Last month
17.4%
212,745,851
Compared to previous month
Last year
7.9%
2,126,018,266
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
6
is-plain-object
Returns true if an object was created by the
Object
constructor, or Object.create(null).
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.
Install
Install with npm:
1$ npm install --save is-plain-object
Use isobject if you only want to check if the value is an object and not an array or null.
Usage
with es modules
1import { isPlainObject } from 'is-plain-object';
or with commonjs
1const { isPlainObject } = require('is-plain-object');
true when created by the Object
constructor, or Object.create(null).
1isPlainObject(Object.create({})); 2//=> true 3isPlainObject(Object.create(Object.prototype)); 4//=> true 5isPlainObject({foo: 'bar'}); 6//=> true 7isPlainObject({}); 8//=> true 9isPlainObject(null); 10//=> true
false when not created by the Object
constructor.
1isPlainObject(1); 2//=> false 3isPlainObject(['foo', 'bar']); 4//=> false 5isPlainObject([]); 6//=> false 7isPlainObject(new Foo); 8//=> false 9isPlainObject(Object.create(null)); 10//=> false
About
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running Tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
1$ npm install && npm test
Building docs
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
1$ npm install -g verbose/verb#dev verb-generate-readme && verb
Related projects
You might also be interested in these projects:
- is-number: Returns true if a number or string value is a finite number. Useful for regex… more | homepage
- isobject: Returns true if the value is an object and not an array or null. | homepage
- kind-of: Get the native type of a value. | homepage
Contributors
Commits | Contributor |
---|---|
19 | jonschlinkert |
6 | TrySound |
6 | stevenvachon |
3 | onokumus |
1 | wtgtybhertgeghgtwtg |
Author
Jon Schlinkert
License
Copyright © 2019, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.8.0, on April 28, 2019.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 4/24 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 13 are checked with a SAST tool
Score
3.2
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More