Skip to content

KROT47/get-explicit-type

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

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'

About

Returns object constructor name

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published