0.1.7 • Published 3 years ago
@stackmeister/types v0.1.7
@stackmeister/types
Minimalistic and strict utility functions for JavaScript's primitive types.
Install
// Yarn
yarn add @stackmeister/types
// NPM
npm i @stackmeister/typesTypeScript typings are included (No @types/ package needed)
Usage
Predicates for simple type checks
import {
isUndefined,
isNull,
isNullOrUndefined,
isBoolean,
isString,
isNumber,
isInteger,
isNumeric,
isArray,
isObject,
isFunction,
} from '@stackmeister/types'
isUndefined('test') // false
isUndefined(undefined) // true
isUndefined(null) // false
isNull('test') // false
isNull(null) // true
isNull(undefined) // false
// etc...Notice: In the Stackmeister typing mindset, objects and arrays are two very different things An object will not be an object, when it is an array. It will only match the
isArraypredicate.