This commit is contained in:
David Kale
2020-09-08 13:25:36 -04:00
parent e4246d2b5b
commit 91fcbb0108
4227 changed files with 416837 additions and 457884 deletions

View File

@@ -1,6 +1,6 @@
# is-plain-object [![NPM version](https://img.shields.io/npm/v/is-plain-object.svg?style=flat)](https://www.npmjs.com/package/is-plain-object) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-plain-object.svg?style=flat)](https://npmjs.org/package/is-plain-object) [![NPM total downloads](https://img.shields.io/npm/dt/is-plain-object.svg?style=flat)](https://npmjs.org/package/is-plain-object) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-plain-object.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-plain-object)
> Returns true if an object was created by the `Object` constructor.
> Returns true if an object was created by the `Object` constructor, or Object.create(null).
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
@@ -20,7 +20,7 @@ Use [isobject](https://github.com/jonschlinkert/isobject) if you only want to ch
import isPlainObject from 'is-plain-object';
```
**true** when created by the `Object` constructor.
**true** when created by the `Object` constructor, or Object.create(null).
```js
isPlainObject(Object.create({}));
@@ -31,6 +31,8 @@ isPlainObject({foo: 'bar'});
//=> true
isPlainObject({});
//=> true
isPlainObject(null);
//=> true
```
**false** when not created by the `Object` constructor.
@@ -44,8 +46,6 @@ isPlainObject([]);
//=> false
isPlainObject(new Foo);
//=> false
isPlainObject(null);
//=> false
isPlainObject(Object.create(null));
//=> false
```
@@ -116,4 +116,4 @@ Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 28, 2019._
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 28, 2019._

View File

@@ -1,16 +1,5 @@
'use strict';
/*!
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function isObject(val) {
return val != null && typeof val === 'object' && Array.isArray(val) === false;
}
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
@@ -18,23 +7,22 @@ function isObject(val) {
* Released under the MIT License.
*/
function isObjectObject(o) {
return isObject(o) === true
&& Object.prototype.toString.call(o) === '[object Object]';
function isObject(o) {
return Object.prototype.toString.call(o) === '[object Object]';
}
function isPlainObject(o) {
var ctor,prot;
if (isObjectObject(o) === false) return false;
if (isObject(o) === false) return false;
// If has modified constructor
ctor = o.constructor;
if (typeof ctor !== 'function') return false;
if (ctor === undefined) return true;
// If has modified prototype
prot = ctor.prototype;
if (isObjectObject(prot) === false) return false;
if (isObject(prot) === false) return false;
// If constructor does not have an Object-specific method
if (prot.hasOwnProperty('isPrototypeOf') === false) {

View File

@@ -5,25 +5,22 @@
* Released under the MIT License.
*/
import isObject from 'isobject';
function isObjectObject(o) {
return isObject(o) === true
&& Object.prototype.toString.call(o) === '[object Object]';
function isObject(o) {
return Object.prototype.toString.call(o) === '[object Object]';
}
export default function isPlainObject(o) {
function isPlainObject(o) {
var ctor,prot;
if (isObjectObject(o) === false) return false;
if (isObject(o) === false) return false;
// If has modified constructor
ctor = o.constructor;
if (typeof ctor !== 'function') return false;
if (ctor === undefined) return true;
// If has modified prototype
prot = ctor.prototype;
if (isObjectObject(prot) === false) return false;
if (isObject(prot) === false) return false;
// If constructor does not have an Object-specific method
if (prot.hasOwnProperty('isPrototypeOf') === false) {
@@ -32,4 +29,6 @@ export default function isPlainObject(o) {
// Most likely a plain Object
return true;
};
}
export default isPlainObject;

View File

@@ -1,33 +1,28 @@
{
"_args": [
[
"is-plain-object@3.0.0",
"C:\\Users\\damccorm\\Documents\\labeler"
]
],
"_from": "is-plain-object@3.0.0",
"_id": "is-plain-object@3.0.0",
"_from": "is-plain-object@^4.0.0",
"_id": "is-plain-object@4.1.1",
"_inBundle": false,
"_integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==",
"_integrity": "sha512-5Aw8LLVsDlZsETVMhoMXzqsXwQqr/0vlnBYzIXJbYo2F4yYlhLHs+Ez7Bod7IIQKWkJbJfxrWD7pA1Dw1TKrwA==",
"_location": "/is-plain-object",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "is-plain-object@3.0.0",
"raw": "is-plain-object@^4.0.0",
"name": "is-plain-object",
"escapedName": "is-plain-object",
"rawSpec": "3.0.0",
"rawSpec": "^4.0.0",
"saveSpec": null,
"fetchSpec": "3.0.0"
"fetchSpec": "^4.0.0"
},
"_requiredBy": [
"/@octokit/endpoint",
"/@octokit/request"
],
"_resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz",
"_spec": "3.0.0",
"_where": "C:\\Users\\damccorm\\Documents\\labeler",
"_resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-4.1.1.tgz",
"_shasum": "1a14d6452cbd50790edc7fdaa0aed5a40a35ebb5",
"_spec": "is-plain-object@^4.0.0",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/@octokit/request",
"author": {
"name": "Jon Schlinkert",
"url": "https://github.com/jonschlinkert"
@@ -35,6 +30,7 @@
"bugs": {
"url": "https://github.com/jonschlinkert/is-plain-object/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Jon Schlinkert",
@@ -50,27 +46,28 @@
},
{
"url": "https://github.com/wtgtybhertgeghgtwtg"
},
{
"name": "Bogdan Chadkin",
"url": "https://github.com/TrySound"
}
],
"dependencies": {
"isobject": "^4.0.0"
},
"description": "Returns true if an object was created by the `Object` constructor.",
"deprecated": false,
"description": "Returns true if an object was created by the `Object` constructor, or Object.create(null).",
"devDependencies": {
"chai": "^4.2.0",
"esm": "^3.2.22",
"gulp-format-md": "^1.0.0",
"mocha": "^6.1.4",
"mocha-headless-chrome": "^2.0.2",
"rollup": "^1.10.1",
"rollup-plugin-node-resolve": "^4.2.3"
"mocha-headless-chrome": "^3.1.0",
"rollup": "^2.22.1"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.d.ts",
"index.js",
"index.es.js",
"index.cjs.js"
],
"homepage": "https://github.com/jonschlinkert/is-plain-object",
@@ -90,7 +87,7 @@
],
"license": "MIT",
"main": "index.cjs.js",
"module": "index.js",
"module": "index.es.js",
"name": "is-plain-object",
"repository": {
"type": "git",
@@ -124,5 +121,5 @@
"reflinks": true
}
},
"version": "3.0.0"
"version": "4.1.1"
}