@beautiful-code/type-utils

0.1.6 • Public • Published

Type Utils

This is a simple, type identification and validation library. This handles both native types, and es6 types, as well as jQuery objects. This is intended to be used imported via Node.js (or a bundler like Webpack for client side).

Installation

Using NPM or Yarn

npm install '@beautiful-code/type-utils'
yard add '@beautiful-code/type-utils'

Usage

Basic Usage

const TypeUtils = require('@beautiful-code/type-utils').TypeUtils

let o = {},
	a = [1, 2, 3],
	s = 'string',
	m = new Map()
TypeUtils.getType(o) // object
TypeUtils.getType(a) // array
TypeUtils.getType(s) // string
TypeUtils.getType(m) // map

Readme

Keywords

none

Package Sidebar

Install

npm i @beautiful-code/type-utils

Weekly Downloads

21

Version

0.1.6

License

MIT

Last publish

Collaborators

  • mynamereallysux