🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

instanceof

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

instanceof - npm Package Compare versions

Comparing version

to
1.0.2

36

index.js

@@ -24,21 +24,21 @@

function _Instanceof( obj, type ) {
switch ( typeof type ) {
case 'number':
if ( isNaN( type ) ) type = 'nan';
else throw Error( 'type must be function, string, object or NaN' );
break;
case 'string':
type = type.toLowerCase();
break;
}
switch ( typeof type ) {
case 'number':
if ( isNaN( type ) ) type = 'nan';
else throw Error( 'type must be function, string, object or NaN' );
break;
case 'string':
type = type.toLowerCase();
break;
}
switch ( type ) {
case 'nan':
return typeof obj == 'number' && isNaN( obj )
break;
case Object:
case Object:
case 'object':

@@ -77,9 +77,9 @@ return !Array.isArray( obj ) && obj !== null && typeof obj == 'object'

break;
case undefined:
case undefined:
case 'undefined':
return obj === undefined
break;
case Symbol:
case Symbol:
case 'symbol':

@@ -86,0 +86,0 @@ return typeof obj == 'symbol'

{
"name": "instanceof",
"version": "1.0.1",
"version": "1.0.2",
"description": "JavaScript all types detection module (crossbrowser)",

@@ -5,0 +5,0 @@ "main": "index.js",