Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

i-s

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i-s

A module to check whether a JavaScript value is of a certain type

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

i-s

Checks whether a JavaScript valis is of a certain type

Install

npm install i-s

Usage

var is = require('i-s')

API

numeric

is.numeric('567') === true
is.numeric('a') === false
is.numeric(4) === true

number

is.number('567') === false
is.number('a') === false
is.number(4) === true
is.number(4.3) === true

int

is.int('567') === false
is.int('a') === false
is.int(4) === true
is.int(4.3) === false

float

is.number('567') === false
is.number('a') === false
is.number(4) === false
is.number(4.3) === true

string

is.string('abc') === true

function

function f(){}
is.function(f) === true

object

is.object({}) === true

arguments

is.arguments(function(){return arguments}()) === true
is.arguments([]) === false

boolean

is.boolean(true) === true
is.boolean(false) === true
is.boolean({}) === false

date

is.date(new Date()) === true

regexp

is.regexp(/a/) === true
is.regexp(new RegExp('/a/')) === true

array

is.array([]) === true
is.array(function(){ return arguments }()) === false

Tests

make

License

MIT

Keywords

FAQs

Package last updated on 02 Sep 2014

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

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