is-obj
Advanced tools
Comparing version 1.0.1 to 2.0.0
'use strict'; | ||
module.exports = function (x) { | ||
var type = typeof x; | ||
return x !== null && (type === 'object' || type === 'function'); | ||
module.exports = value => { | ||
const type = typeof value; | ||
return value !== null && (type === 'object' || type === 'function'); | ||
}; |
{ | ||
"name": "is-obj", | ||
"version": "1.0.1", | ||
"description": "Check if a value is an object", | ||
"license": "MIT", | ||
"repository": "sindresorhus/is-obj", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"obj", | ||
"object", | ||
"is", | ||
"check", | ||
"test", | ||
"type" | ||
], | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
"name": "is-obj", | ||
"version": "2.0.0", | ||
"description": "Check if a value is an object", | ||
"license": "MIT", | ||
"repository": "sindresorhus/is-obj", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava && tsd" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
"keywords": [ | ||
"object", | ||
"is", | ||
"check", | ||
"test", | ||
"type" | ||
], | ||
"devDependencies": { | ||
"ava": "^1.4.1", | ||
"tsd": "^0.7.2", | ||
"xo": "^0.24.0" | ||
} | ||
} |
@@ -12,3 +12,3 @@ # is-obj [![Build Status](https://travis-ci.org/sindresorhus/is-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/is-obj) | ||
``` | ||
$ npm install --save is-obj | ||
$ npm install is-obj | ||
``` | ||
@@ -20,11 +20,11 @@ | ||
```js | ||
const isObj = require('is-obj'); | ||
const isObject = require('is-obj'); | ||
isObj({foo: 'bar'}); | ||
isObject({foo: 'bar'}); | ||
//=> true | ||
isObj([1, 2, 3]); | ||
isObject([1, 2, 3]); | ||
//=> true | ||
isObj('foo'); | ||
isObject('foo'); | ||
//=> false | ||
@@ -34,4 +34,9 @@ ``` | ||
## Related | ||
- [is](https://github.com/sindresorhus/is) - Type check values | ||
## License | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
Sorry, the diff of this file is not supported yet
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2821
5
21
40
0
3