isobject
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -10,5 +10,5 @@ /*! | ||
module.exports = function isObject(o) { | ||
return o != null && typeof o === 'object' | ||
&& !Array.isArray(o); | ||
}; | ||
module.exports = function isObject(val) { | ||
return Object.prototype.toString.call(val) === '[object Object]' | ||
&& typeof val === 'object'; | ||
}; |
{ | ||
"name": "isobject", | ||
"description": "Returns true if the value is an object and not an array or null.", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"homepage": "https://github.com/jonschlinkert/isobject", | ||
@@ -35,14 +35,19 @@ "author": { | ||
"keywords": [ | ||
"check", | ||
"function", | ||
"is", | ||
"is-object", | ||
"isobject", | ||
"is-object", | ||
"javascript", | ||
"kind", | ||
"kind-of", | ||
"kindof", | ||
"native", | ||
"object", | ||
"of", | ||
"type", | ||
"typeof", | ||
"kind", | ||
"kindof", | ||
"value", | ||
"javascript", | ||
"check" | ||
"validate", | ||
"value" | ||
] | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# isobject [![NPM version](https://badge.fury.io/js/isobject.svg)](http://badge.fury.io/js/isobject) | ||
# isobject [![NPM version](https://badge.fury.io/js/isobject.svg)](http://badge.fury.io/js/isobject) [![Build Status](https://travis-ci.org/jonschlinkert/isobject.svg)](https://travis-ci.org/jonschlinkert/isobject) | ||
@@ -8,6 +8,15 @@ > Returns true if the value is an object and not an array or null. | ||
## Install | ||
```bash | ||
npm i isobject --save | ||
Install with [npm](https://www.npmjs.com/) | ||
```sh | ||
$ npm i isobject --save | ||
``` | ||
Install with [bower](http://bower.io/) | ||
```sh | ||
$ bower install isobject --save | ||
``` | ||
## Usage | ||
@@ -21,23 +30,11 @@ | ||
All of the following return `true`: | ||
```js | ||
isObject({}); | ||
//=> true | ||
isObject(Object.create({})); | ||
//=> true | ||
isObject(Object.create(Object.prototype)); | ||
//=> true | ||
isObject(Object.create(null)); | ||
//=> true | ||
isObject({}); | ||
//=> true | ||
isObject(new Foo); | ||
//=> true | ||
isObject(/foo/); | ||
//=> true | ||
``` | ||
@@ -47,29 +44,41 @@ | ||
All of the following return `false`: | ||
```js | ||
isObject(); | ||
isObject(/foo/); | ||
isObject(function () {}); | ||
//=> false | ||
isObject(1); | ||
//=> false | ||
isObject([]); | ||
//=> false | ||
isObject(undefined); | ||
isObject(null); | ||
//=> false | ||
``` | ||
## Related projects | ||
* [assign-deep](https://github.com/jonschlinkert/assign-deep): Deeply assign the enumerable properties of source objects to a destination object. | ||
* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | ||
* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. | ||
* [is-extendable](https://github.com/jonschlinkert/is-extendable): Returns true if a value is any of the object types: array, regexp, plain object,… [more](https://github.com/jonschlinkert/is-extendable) | ||
* [is-equal-shallow](https://github.com/jonschlinkert/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ. | ||
* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. | ||
## Contributing | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/isobject/issues/new) | ||
## Author | ||
**Jon Schlinkert** | ||
+ [github/jonschlinkert](https://github.com/jonschlinkert) | ||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
## License | ||
Copyright (c) 2015 Jon Schlinkert | ||
Released under the MIT license | ||
Copyright © 2014-2015 [Jon Schlinkert](https://github.com/jonschlinkert) | ||
Released under the [MIT](https://github.com/jonschlinkert/isobject/blob/master/LICENSE) license. | ||
*** | ||
_This file was generated by [verb](https://github.com/assemble/verb) on February 25, 2015._ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 04, 2015._ |
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
4966
11
81
0