Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@itsjonq/is

itsjonq3.3kMIT0.0.5TypeScript support: included

A tiny type checker

type, check, checker, typechecker, typechecking, type-checking, check-type, plain-object, tiny, is, small

readme

💡 is

Build Status codecov Bundle size

A tiny type checker

is is a simple sub 400B type checking library for JavaScript.
For a more feature-packed version, check out @sindresorhus/is.

Table of Contents

Installation

npm install @itsjonq/is

Usage

import is from '@itsjonq/is';

is.string('Hello');
// true

const fn = () => 'Nope';

is.string(fn);
// false
is.function(fn);
// true
is.object(fn);
// true
is.plainObject(fn);
// false

Supported types

  • is.array
  • is.blob
  • is.boolean
  • is.defined
  • is.file
  • is.function
  • is.map
  • is.null
  • is.number
  • is.object
  • is.plainObject
  • is.regExp
  • is.string
  • is.symbol
  • is.undefined
  • is.weakMap