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 1.0.2 to 1.0.3

6

index.js

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

}
var reg = /\[object Arguments\]/i;
var reg = /^\[object Arguments\]$/i;
if(isTypeString){

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

if(val===null||val===undefined) return false;
if((reg).test(val.toString())&&t.some((i)=>i==='arguments')) return true;
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());

@@ -30,5 +30,5 @@ }

if(val===null||val===undefined) return false;
if(type.test('arguments')&&(reg).test(val.toString())) return true;
if(type.test('arguments')&&val.constructor.name==='Object'&&(reg).test(val.toString())) return true;
return type.test(val.constructor.name);
}
};
{
"name": "of-type",
"version": "1.0.2",
"version": "1.0.3",
"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