Socket
Socket
Sign inDemoInstall

is-type-of

Package Overview
Dependencies
2
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.2.1

30

index.js

@@ -42,11 +42,16 @@ /*!

exports.generator = function (obj) {
return obj && 'function' === typeof obj.next && 'function' === typeof obj.throw;
return obj
&& 'function' === typeof obj.next
&& 'function' === typeof obj.throw;
};
exports.generatorFunction = function (obj) {
return obj && obj.constructor && 'GeneratorFunction' === obj.constructor.name;
return obj
&& obj.constructor
&& 'GeneratorFunction' === obj.constructor.name;
};
exports.promise = function (obj) {
return obj && 'function' === typeof obj.then;
return obj
&& 'function' === typeof obj.then;
};

@@ -57,15 +62,26 @@

exports.int = function (obj) {
return utils.isNumber(obj) && obj % 1 === 0;
return utils.isNumber(obj)
&& obj % 1 === 0;
};
exports.int32 = function (obj) {
return exports.int(obj) && (obj < MAX_INT_31 && obj >= -MAX_INT_31);
return exports.int(obj)
&& obj < MAX_INT_31
&& obj >= -MAX_INT_31;
};
exports.long = function (obj) {
return exports.int(obj) && (obj >= MAX_INT_31 || obj < -MAX_INT_31);
if (typeof obj === 'object' && typeof obj.high === 'number' && typeof obj.low === 'number') {
// support `long` module
return true;
}
return exports.int(obj)
&& (obj >= MAX_INT_31 || obj < -MAX_INT_31);
};
exports.double = function (obj) {
return utils.isNumber(obj) && !isNaN(obj) && obj % 1 !== 0;
return utils.isNumber(obj)
&& !isNaN(obj)
&& obj % 1 !== 0;
};

@@ -72,0 +88,0 @@

{
"name": "is-type-of",
"version": "0.2.0",
"version": "0.2.1",
"description": "complete type checking for node",

@@ -11,3 +11,3 @@ "main": "index.js",

"type": "git",
"url": "git://github.com/dead-horse/is-type-of.git"
"url": "git://github.com/node-modules/is-type-of.git"
},

@@ -24,15 +24,17 @@ "files": ["index.js"],

"bugs": {
"url": "https://github.com/dead-horse/is-type-of/issues"
"url": "https://github.com/node-modules/is-type-of/issues"
},
"homepage": "https://github.com/dead-horse/is-type-of",
"homepage": "https://github.com/node-modules/is-type-of",
"devDependencies": {
"autod": "^0.1.1",
"istanbul": "git://github.com/gotwarlost/istanbul.git#harmony",
"contributors": "*",
"istanbul-harmony": "*",
"long": "1.1.2",
"mocha": "^1.17.1",
"should": "3.2.0"
"should": "3.3.1"
},
"dependencies": {
"core-util-is": "1.0.1",
"isstream": "0.1.0"
"core-util-is": "^1.0.1",
"isstream": "^0.1.0"
}
}

@@ -92,4 +92,6 @@ is-type-of

* Support [Long](https://github.com/dcodeIO/Long.js) instance.
## License
MIT
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc