is-plain-object
Advanced tools
Comparing version 4.0.0 to 4.1.0
'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> | ||
@@ -21,6 +10,4 @@ * | ||
function isObjectObject(o) { | ||
var type = Object.prototype.toString.call(o); | ||
return isObject(o) === true | ||
&& (type === '[object Object]' || type === '[object Null]'); | ||
function isObject(o) { | ||
return Object.prototype.toString.call(o) === '[object Object]'; | ||
} | ||
@@ -31,3 +18,3 @@ | ||
if (isObjectObject(o) === false) return false; | ||
if (isObject(o) === false) return false; | ||
@@ -40,3 +27,3 @@ // If has modified constructor | ||
prot = ctor.prototype; | ||
if (isObjectObject(prot) === false) return false; | ||
if (isObject(prot) === false) return false; | ||
@@ -43,0 +30,0 @@ // If constructor does not have an Object-specific method |
@@ -1,3 +0,3 @@ | ||
declare function isPlainObject(o: any): boolean; | ||
declare function isPlainObject(o: any): asserts o is object; | ||
export default isPlainObject; |
/*! | ||
* 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> | ||
@@ -19,6 +8,4 @@ * | ||
function isObjectObject(o) { | ||
var type = Object.prototype.toString.call(o); | ||
return isObject(o) === true | ||
&& (type === '[object Object]' || type === '[object Null]'); | ||
function isObject(o) { | ||
return Object.prototype.toString.call(o) === '[object Object]'; | ||
} | ||
@@ -29,3 +16,3 @@ | ||
if (isObjectObject(o) === false) return false; | ||
if (isObject(o) === false) return false; | ||
@@ -38,3 +25,3 @@ // If has modified constructor | ||
prot = ctor.prototype; | ||
if (isObjectObject(prot) === false) return false; | ||
if (isObject(prot) === false) return false; | ||
@@ -41,0 +28,0 @@ // If constructor does not have an Object-specific method |
{ | ||
"name": "is-plain-object", | ||
"description": "Returns true if an object was created by the `Object` constructor, or Object.create(null).", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"homepage": "https://github.com/jonschlinkert/is-plain-object", | ||
@@ -38,10 +38,8 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"devDependencies": { | ||
"@rollup/plugin-node-resolve": "^8.1.0", | ||
"chai": "^4.2.0", | ||
"esm": "^3.2.22", | ||
"gulp-format-md": "^1.0.0", | ||
"isobject": "^4.0.0", | ||
"mocha": "^6.1.4", | ||
"mocha-headless-chrome": "^3.1.0", | ||
"rollup": "^2.18.1" | ||
"rollup": "^2.22.1" | ||
}, | ||
@@ -48,0 +46,0 @@ "keywords": [ |
@@ -23,3 +23,3 @@ # 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) | ||
**true** when created by the `Object` constructor. | ||
**true** when created by the `Object` constructor, or Object.create(null). | ||
@@ -35,2 +35,4 @@ ```js | ||
//=> true | ||
isPlainObject(null); | ||
//=> true | ||
``` | ||
@@ -49,4 +51,2 @@ | ||
//=> false | ||
isPlainObject(null); | ||
//=> false | ||
isPlainObject(Object.create(null)); | ||
@@ -53,0 +53,0 @@ //=> false |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6
8848
55