Socket
Socket
Sign inDemoInstall

is-type-of

Package Overview
Dependencies
1
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0 to 0.0.1

15

index.js

@@ -36,1 +36,16 @@ /*!

};
var MAX_INT_31 = Math.pow(2, 31);
exports.int = function (obj) {
return utils.isNumber(obj) && obj % 1 === 0;
};
exports.long = function (obj) {
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;
};

8

package.json
{
"name": "is-type-of",
"version": "0.0.0",
"version": "0.0.1",
"description": "complete type checking for node",

@@ -27,3 +27,7 @@ "main": "index.js",

"devDependencies": {
"autod": "^0.1.1"
"autod": "^0.1.1",
"co-wait": "0.0.0",
"istanbul": "git://github.com/gotwarlost/istanbul.git#harmony",
"should": "^3.1.3",
"mocha": "^1.17.1"
},

@@ -30,0 +34,0 @@ "dependencies": {

is-type-of
==========
complete type checking for node
complete type checking for node, extend [core-util-is](https://github.com/isaacs/core-util-is)
## Install
```
npm install is-type-of
```
## Example
```
var is = require('is-type-of');
is.array([1]); // => true
is.primitive(true); // => true
is.primitive({}); // => false
is.generatorFunction(function * () {}); // => true
is.long(Math.pow(2, 33)); // => true
is.double(0); // => false
```
## API
### From [core-util-is](https://github.com/isaacs/core-util-is)
#### is.array(arr)
#### is.boolean(bool)
#### is.null(null)
#### is.nullOrUndefined(null)
#### is.number(num)
#### is.string(str)
#### is.symbol(sym)
#### is.undefined(undef)
#### is.regExp(reg)
#### is.object(obj)
#### is.date(date)
#### is.error(err)
#### is.function(fn)
#### is.primitive(prim)
#### is.buffer(buf)
### Extend API
#### is.generator(gen)
#### is.generatorFunction(fn)
#### is.promise(fn)
#### is.int(int)
#### is.double(double)
#### is.long(long)
## 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