js-type-helper
v0.0.2
Published
description here
Downloads
2
Readme
TypeJS
TypeJS is lightweight library its give to developer additional functionality for a manipulation (check, validate and using) JavaScript data types. Library support both (AMD, CommonJS)
Docs
Version
Install
CDN
<script type="text/javascript" src="https://cdn.rawgit.com/Hamik25/TypeJS/master/dist/bundle.js"></script>
NPM
$ npm install js-type-helper
Yarn
$ yarn add js-type-helper
Code Examples
const str = 'some text';
TypeJS.getType(str) // String
const intNum = 5;
TypeJS.getType(intNum) // Int
const floatNum = 8.469;
TypeJS.getType(floatNum) // Float
const infNum = 8 / 0;
TypeJS.getType(infNum) // Infinity
const negInfNum = -2 / 0;
TypeJS.getType(negInfNum) // -Infinity
const nanNum = 80 / 'some text';
TypeJS.getType(nanNum) // NaN
const obj = {};
TypeJS.getType(obj) // Object
const nul = null;
TypeJS.getType(nul) // Null
const unDef;
TypeJS.getType(unDef) // Undefined
const bool = true;
TypeJS.getType(bool) // Boolean
const arr = [0, 1, 2];
TypeJS.getType(str) // Array
const foo = function() {};
TypeJS.getType(str) // Function
const date = new Date();
TypeJS.getType(str) // Date