New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

typeof

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeof - npm Package Compare versions

Comparing version 0.9.1 to 1.0.0

MIT-LICENSE

9

package.json
{
"name": "typeof",
"version": "0.9.1",
"description": "Node module. typeOf('a string') == 'string', typeOf([]) == 'array', etc..",
"version": "1.0.0",
"description": "Node module. typeOf('a string') == 'string', typeOf([]) == 'array', etc.. Also supports named functions detections aka javascript classes",
"main": "index.js",
"scripts": {
"test": "./node_modules/mocha/bin/mocha -R spec --compilers coffee:coffee-script test.coffee"
"test": "mocha -R spec --compilers coffee:coffee-script test.coffee"
},

@@ -19,3 +19,4 @@ "repository": {

"license": "MIT",
"dependencies": {
"dependencies": {},
"devDependencies": {
"coffee-script": "~1.4.0",

@@ -22,0 +23,0 @@ "mocha": "~1.6.0",

# typeof
small node.js module that extends functionality of native typeof
inspired by Batman.js typeOf util
**-------------------------------**
**UPD:** now it returns lowercased name of any javascript class.
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:

@@ -18,5 +19,12 @@

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"

@@ -27,10 +35,3 @@ function MyClass() {

console.log(typeOf(new MyClass));
// ->"myclass"
```
```
"string"
"array"
"null"
"buffer"
"myclass"
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc