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.1 to 2.1.3

12

index.js

@@ -23,12 +23,12 @@ module.exports = function(val,type){

if(!type.length) return true;
for(var i in type){
if(type[i]===null&&vNull) return true;
if(typeof type[i]==='undefined'&&vUnd) return true;
for(var t of type){
if(t===null&&vNull) return true;
if(typeof t==='undefined'&&vUnd) return true;
if(vNull||vUnd) continue;
if(type[i]===null||typeof type[i]==='undefined') continue;
if(Object.getPrototypeOf(val).constructor.name === type[i].name) return true;
if(t===null||typeof t==='undefined') continue;
if(Object.getPrototypeOf(val).constructor.name === t.name) return true;
}
return false;
}
if(tString){

@@ -35,0 +35,0 @@ var t = type.toLowerCase().split('|');

{
"name": "of-type",
"version": "2.1.1",
"version": "2.1.3",
"description": "Check if the given value is of the particular type or types.",

@@ -17,3 +17,3 @@ "main": "index.js",

],
"author": "Paweł Rafałko",
"author": "Pawel Rafalko",
"license": "MIT",

@@ -20,0 +20,0 @@ "repository": {

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