1.0.2 • Published 8 years ago

get-explicit-type v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

GetExplicitType

Returns any variable explicit type, taken from its constructor name:
{ Array | Arguments | Object | Function | RegExp | Number | String | Symbol | Promise }

Usage:

const GetType = require( 'get-explicit-type' );

// GetType( {obj|Mixed} ) => {String}

var type = GetType( [] );

console.log( type ) => 'Array'


/* ------------ Careful ------------- */

class Test {}

var type = GetType( new Test );

console.log( type ) => 'Object'