Skip to content

zcorky/is

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is

NPM version Coverage Status Dependencies Build Status license issues

A TypeCheck lib

Install

$ npm install @zcorky/is

Usage

// typescript
import * as is from '@zcorky/is';

// primitive
is.nul(null);
is.undefined(undefined);
is.string('');
is.number(1);
is.boolean(false);
is.symbol(Symbol());

// primitive
is.primitive(true);

// array
is.array([]);

// function
is.func(() => null);

// object
is.object({});

// promise
is.promise(promise);

// date
is.date(new Date());
is.date(+ new Date());
is.date(new Date().toString());

// integer
is.integer(10);
is.int(10);
is.safeInteger(Math.pow(2, 53) - 1);
is.safeInt(Math.pow(2, 53) - 1);

// float
is.float(10.1);

Relatived

  • is - Type check values: is.string('🦄') //=> true
  • joi - Object schema validation.
  • ajv - The fastest JSON Schema Validator.
  • parameter - A parameter verify tools.
  • type-is - Infer the content-type of a request.

License

MIT © Moeover

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published