0.0.2 • Published 6 years ago

js-type-helper v0.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

Build Status Coverage Status

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

npm version GitHub 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

License

MIT

0.0.2

6 years ago

0.0.1

6 years ago

1.0.0

6 years ago