type-predicate-utils
v1.0.9
Published
A collection of predicate functions for checking variable types, written in TypeScript
Downloads
3
Maintainers
Readme
type-predicate-utils
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