Skip to content

gadge/typen

Repository files navigation

@typen

🐡 Type checker

npm version github commit last github commit total npm license

Features

  • Check primitive or object type of a variable in one function.
  • Check whether a variable is numeric in different strictness (and different overhead).
  • Parse variable to boolean.
  • Check type of an array.
  • Lightweight and fast.
  • ES-module support.

Install

$ npm install @typen/<tool-name>

Tools

typ shorthand for Object.prototype.toString.call() v
bool parse input to boolean, e.g. 'false' be parsed to false v
nullish check if input is null or undefined v
num-loose isNumeric in a loose check v
num-strict isNumeric in a stricter check v
vector-type check type of an array v
enum-data-types types returned by typeof v
enum-object-types types returned by Object.prototype.toString.call() v

Meta

LICENSE (MIT)