Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

istype

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

istype

Cross-vm type checking utils for javascript

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

istype

Cross-vm type checking utils for javascript

Node.js:

Build Status

Browsers:

Selenium Test Status

Installation

npm install --save istype

Usage

var is = require('istype');


is.func(Object); // true

is.number(5); // true
is.number(new Number(5)); // true

is.boolean(false); // true
is.boolean(new Boolean(false)); // true

is.string('string'); // true
is.string(new String('string')); // true

is.nil(null); // true
is.nil(undefined); // true

is.undefined(undefined); // true
is.undefined(null); // false

is.regexp(/regexp/); // true
is.regexp(new RegExp('regexp')); // true

is.date(new Date()); // true

is.array([]); // true
is.array(new Array()); // true

is.type(null); // 'null'
is.type(undefined) // 'undefined'
is.type(5); // 'number'
is.type(new Number(5)); // 'number'
is.type(true); // 'boolean'
is.type(new Boolean(true)); // 'boolean'
is.type('str'); // 'string'
is.type(new String('str')); // 'string'
is.type(new Date()); // 'date';
is.type(new RegExp('regexp')); // 'regexp'
is.type(/regexp/); // 'regexp'
is.type(new Array()); // 'array'
is.type([]); // 'array'
is.type(new Function()); // 'function'
is.type(Object); // 'function'

Keywords

type

FAQs

Package last updated on 19 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts