type-predicate-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

type-predicate-utils

Build Status Coverage Status npm version

Description:

A collection of simple predicate functions, written in TypeScript, for checking variable types. JavaScript UMD and TypeScript declaration file will be generated when building the package.

Installation:

npm install type-predicate-utils

Usage:

import { 
    isString, 
    isBoolean, 
    isDefined, 
    isUndefined, 
    isNull, 
    isObject,
    isArray,
    isEmptyArray,
    isNonEmptyArray,
    isFunction
 } from 'type-predicate-utils';

...

isString('foo')       // true
isBoolean({})         // false
isDefined([])         // true
isUndefined({})       // false
isNull(null)          // true
isObject({})          // true
isArray([])           // true
isEmptyArray([])      // true
isNonEmptyArray([])   // false
isFunction(() => {})  // true

Package Sidebar

Install

npm i type-predicate-utils

Weekly Downloads

1

Version

1.0.9

License

MIT

Unpacked Size

9.66 kB

Total Files

5

Last publish

Collaborators

  • codybonney