Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

of-type

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

of-type - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

12

index.js

@@ -18,3 +18,3 @@ module.exports = function(val,type){

if(vUnd||vNull) return false;
return val.constructor.name === type.name;
return Object.getPrototypeOf(val).constructor.name === type.name;
}

@@ -29,3 +29,3 @@

if(type[i]===null||typeof type[i]==='undefined') continue;
if(val.constructor.name === type[i].name) return true;
if(Object.getPrototypeOf(val).constructor.name === type[i].name) return true;
}

@@ -43,4 +43,4 @@ return false;

if(vNull||val===undefined) return false;
if((reg).test(val.toString())&&val.constructor.name==='Object'&&t.some((i)=>i==='arguments')) return true;
return t.some((i)=>i===val.constructor.name.toLowerCase());
if((reg).test(val.toString())&&Object.getPrototypeOf(val).constructor.name==='Object'&&t.some((i)=>i==='arguments')) return true;
return t.some((i)=>i===Object.getPrototypeOf(val).constructor.name.toLowerCase());
}

@@ -55,6 +55,6 @@

if(vNull||val===undefined) return false;
if(type.test('arguments')&&val.constructor.name==='Object'&&(reg).test(val.toString())) return true;
return type.test(val.constructor.name);
if(type.test('arguments')&&Object.getPrototypeOf(val).constructor.name==='Object'&&(reg).test(val.toString())) return true;
return type.test(Object.getPrototypeOf(val).constructor.name);
}
return false;
};
{
"name": "of-type",
"version": "2.1.0",
"version": "2.1.1",
"description": "Check if the given value is of the particular type or types.",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc