precise-typeof
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -38,7 +38,8 @@ 'use strict'; | ||
// be even more precise by reporting "instance of" names | ||
if (type == 'object' && options.pojoOnly) { | ||
// Note: only check objects that were created by constructors | ||
if (type == 'object' && options.pojoOnly && obj.constructor) { | ||
// some constructors don't have names | ||
type = obj.constructor.name || 'unknown'; | ||
// precerve `object` response for POJOs | ||
// preserve `object` response for POJOs | ||
if (type == 'Object') type = 'object'; | ||
@@ -45,0 +46,0 @@ } |
{ | ||
"name": "precise-typeof", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Better 'typeof'. Detects real type of the objects like 'Array()', 'new Number(1)', 'new Boolean(true)', etc.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,7 +17,7 @@ # precise-typeof [![NPM Module](https://img.shields.io/npm/v/precise-typeof.svg?style=flat)](https://www.npmjs.com/package/precise-typeof) | ||
| compression | size | | ||
| :----------------------- | -----: | | ||
| precise-typeof.js | 1.6 kB | | ||
| precise-typeof.min.js | 794 B | | ||
| precise-typeof.min.js.gz | 389 B | | ||
| compression | size | | ||
| :----------------------- | ------: | | ||
| precise-typeof.js | 1.69 kB | | ||
| precise-typeof.min.js | 809 B | | ||
| precise-typeof.min.js.gz | 391 B | | ||
@@ -24,0 +24,0 @@ |
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
10855
36