Skip to content
This repository has been archived by the owner on Dec 6, 2017. It is now read-only.

ianstormtaylor/is

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is

Simple type checking.

Installation

$ component install ianstormtaylor/is
$ npm install ianstormtaylor/is

Example

var is = require('is');

is.arguments(arguments);   // true
is.array([]);              // true
is.boolean(true);          // true
is.date(new Date);         // true
is.element(document.body); // true
is.function(function(){}); // true
is.fn(function(){});       // true
is.null(null);             // true
is.number(42);             // true
is.object({});             // true
is.regexp(/[A-Za-z0-9]+/); // true
is.string('A');            // true
is.undefined(undefined);   // true
is.nan(NaN);               // true
is.empty([]);              // true

Note: If you need old browser support, use .fn instead of .function.

License

MIT