@thi.ng/checks
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="1.3.2"></a> | ||
## [1.3.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@1.3.1...@thi.ng/checks@1.3.2) (2018-04-04) | ||
### Bug Fixes | ||
* **checks:** add prototype check for isPlainObject(), add tests ([bffc443](https://github.com/thi-ng/umbrella/commit/bffc443)) | ||
<a name="1.3.1"></a> | ||
@@ -8,0 +19,0 @@ ## [1.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/checks@1.3.0...@thi.ng/checks@1.3.1) (2018-04-01) |
@@ -0,1 +1,7 @@ | ||
/** | ||
* Similar to `isObject()`, but also checks if prototype is that of | ||
* `Object` (or `null`). | ||
* | ||
* @param x | ||
*/ | ||
export declare function isPlainObject(x: any): x is Object; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Similar to `isObject()`, but also checks if prototype is that of | ||
* `Object` (or `null`). | ||
* | ||
* @param x | ||
*/ | ||
function isPlainObject(x) { | ||
return Object.prototype.toString.call(x) === "[object Object]"; | ||
let proto; | ||
return Object.prototype.toString.call(x) === "[object Object]" && | ||
(proto = Object.getPrototypeOf(x), proto === null || proto === Object.getPrototypeOf({})); | ||
} | ||
exports.isPlainObject = isPlainObject; |
{ | ||
"name": "@thi.ng/checks", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Single-function sub-modules for type, feature & value checks", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
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
31030
461