@thi.ng/checks
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -6,2 +6,13 @@ # Change Log | ||
## [2.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@2.1.1...@thi.ng/checks@2.1.2) (2019-03-12) | ||
### Bug Fixes | ||
* **checks:** fix [#77](https://github.com/thi-ng/umbrella/issues/77), update & minor optimization isPlainObject() ([47ac88a](https://github.com/thi-ng/umbrella/commit/47ac88a)) | ||
## [2.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@2.1.0...@thi.ng/checks@2.1.1) (2019-03-01) | ||
@@ -8,0 +19,0 @@ |
@@ -1,2 +0,2 @@ | ||
const OBJP = Object.getPrototypeOf({}); | ||
const OBJP = Object.getPrototypeOf; | ||
/** | ||
@@ -9,5 +9,6 @@ * Similar to `isObject()`, but also checks if prototype is that of | ||
export const isPlainObject = (x) => { | ||
let proto; | ||
return (Object.prototype.toString.call(x) === "[object Object]" && | ||
((proto = Object.getPrototypeOf(x)), proto === null || proto === OBJP)); | ||
let p; | ||
return (x != null && | ||
typeof x === "object" && | ||
((p = OBJP(x)) === null || OBJP(p) === null)); | ||
}; |
@@ -101,7 +101,8 @@ 'use strict'; | ||
const OBJP = Object.getPrototypeOf({}); | ||
const OBJP = Object.getPrototypeOf; | ||
const isPlainObject = (x) => { | ||
let proto; | ||
return (Object.prototype.toString.call(x) === "[object Object]" && | ||
((proto = Object.getPrototypeOf(x)), proto === null || proto === OBJP)); | ||
let p; | ||
return (x != null && | ||
typeof x === "object" && | ||
((p = OBJP(x)) === null || OBJP(p) === null)); | ||
}; | ||
@@ -108,0 +109,0 @@ |
@@ -103,7 +103,8 @@ (function (global, factory) { | ||
const OBJP = Object.getPrototypeOf({}); | ||
const OBJP = Object.getPrototypeOf; | ||
const isPlainObject = (x) => { | ||
let proto; | ||
return (Object.prototype.toString.call(x) === "[object Object]" && | ||
((proto = Object.getPrototypeOf(x)), proto === null || proto === OBJP)); | ||
let p; | ||
return (x != null && | ||
typeof x === "object" && | ||
((p = OBJP(x)) === null || OBJP(p) === null)); | ||
}; | ||
@@ -110,0 +111,0 @@ |
{ | ||
"name": "@thi.ng/checks", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Single-function sub-modules for type, feature & value checks", | ||
@@ -55,3 +55,3 @@ "module": "./index.js", | ||
"sideEffects": false, | ||
"gitHead": "e43f57c7554fd78380bba58d37ae62ca01221eeb" | ||
"gitHead": "05e82adc716d6b422fbfac861723fac5babeeb83" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
55560
117
604