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

1.3.0 • Public • Published

Build Status

Simple type checks

This is a minimal helper library for type checking in JavaScript. In most cases you will NOT need it. The only case where this comes handy when you have to do a lot of type checking in your code. In these cases writing multiple typeof myvalue === 'whatever' can become quite noisy.

API

function Check if
isUndef ...value is undefined
isNull ...value is null
isNullOrUndef ...value is undefined or null
isString ...value is a string
isNumber ...value is a number, excluding NaN
isBool ...value is a boolean
isDate ...value is a Date-object
isFormatDate ...value has the format YYYY-MM-DD
isFormatDateTime ...value has the format YYYY-MM-DD hh:mm:ss
isFormatDateUTC ...value has the format YYYY-MM-DDThh:mm:ssZ
isObject ...value is an Object (Note: Arrays are objects too)
isEmpty ...value is "", {}, [], undefined or null

LICENSE

See LICENSE.md

Readme

Keywords

Package Sidebar

Install

npm i type-checks

Weekly Downloads

2

Version

1.3.0

License

MIT

Last publish

Collaborators

  • marvinhagemeister