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.3 to 1.0.4

testing.js

8

index.js

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

if((t.length===1&&t[0]==='')||(t.some((i)=>i==='any'))) return true;
if(t.some((i)=>i==='truthy')) return !!val;
if(t.some((i)=>i==='falsy')) return !val;
if(t.some((i)=>i==='truthy')&&!!val) return true;
if(t.some((i)=>i==='falsy')&&!val) return true;
if(typeof val==='undefined'&&t.some((i)=>i==='undefined')) return true;

@@ -24,4 +24,4 @@ if(val===null&&t.some((i)=>i==='null')) return true;

if(type.test('any')||type.test('')) return true;
if(type.test('truthy')&&!!val) return !!val;
if(type.test('falsy')&&!val) return !val;
if(type.test('truthy')&&!!val) return true;
if(type.test('falsy')&&!val) return true;
if(type.test('undefined')&&typeof val==='undefined') return true;

@@ -28,0 +28,0 @@ if(type.test('null')&&val===null) return true;

{
"name": "of-type",
"version": "1.0.3",
"version": "1.0.4",
"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