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.0.2 to 2.1.0

1

index.js

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

if(tArr){
if(!type.length) return true;
for(var i in type){

@@ -24,0 +25,0 @@ if(type[i]===null&&vNull) return true;

2

package.json
{
"name": "of-type",
"version": "2.0.2",
"version": "2.1.0",
"description": "Check if the given value is of the particular type or types.",

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

@@ -11,2 +11,3 @@ # Description

* the value can be now checked with the `function:constructor` objects, `null` or `undefined` *(or array of these items)*
* the **empty** array passed as the second argument is equal to 'any', or /any/ types. The modules function returns `true` for the values of **any** type.
* the TypeError is not throwing when the arguments passed through module function are incorrect *(missing)*. It return `false` instead.

@@ -54,3 +55,3 @@ * tests added

* The **`type`** can contain the value: `'falsy'` or `/falsy/`. It returns `true` for the **`val`** values like: `""`, `false`, `0`, `null`, `undefined`, etc.
* The **`type`** can contain the value: `''` or `'any'` or `/any/`, It returns `true` for the **`val`** values of **any type**
* The **`type`** can contain the value: `''` or `[]` or `'any'` or `/any/`, It returns `true` for the **`val`** values of **any type**

@@ -192,2 +193,8 @@ #### Return value

ofType(null,[]); //true
ofType("hello world",[]); //true
ofType(Number,[]); //true
ofType(0,[]); //true
ofType(new Date(),[]); //true
ofType(null,null); //true

@@ -194,0 +201,0 @@ ofType(undefined,null); //false

Sorry, the diff of this file is too big to display

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