Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CodingFu/typeof

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

15 Commits

Repository files navigation

typeof

Small node.js module that dramatically extends functionality of native typeof

Inspired by Batman.js typeOf util

UPD: now it returns lowercased name of any javascript class. Thanks to @BallBearing for idea

Usage:

$ npm install typeof
var typeOf = require('typeof');
console.log(typeOf("a string"));
// -> "string"
console.log(typeOf([1, 2, 3, "array"]));
// -> "array"
console.log(typeOf(null));
// -> "null"
console.log(typeOf(new Buffer(0)));
// -> "buffer"
function MyClass() {
 this.is = "class constructor" 
}
console.log(typeOf(new MyClass));
// ->"myclass"

About

node module extending typeof functionality

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /