has-own-deep
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "has-own-deep", | ||
"description": "Returns true if an object has an own, nested property.", | ||
"version": "0.1.0", | ||
"description": "Returns true if an object has an own, nested property using dot notation paths ('a.b.c').", | ||
"version": "0.1.1", | ||
"homepage": "https://github.com/jonschlinkert/has-own-deep", | ||
@@ -31,3 +31,2 @@ "author": { | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -37,3 +36,19 @@ "mocha": "*", | ||
}, | ||
"keywords": [] | ||
"keywords": [ | ||
"check", | ||
"deep", | ||
"dot", | ||
"has", | ||
"has-own", | ||
"key", | ||
"keys", | ||
"nested", | ||
"notation", | ||
"object", | ||
"own", | ||
"paths", | ||
"prop", | ||
"property", | ||
"value" | ||
] | ||
} |
@@ -1,4 +0,4 @@ | ||
# has-own-deep [![NPM version](https://badge.fury.io/js/has-own-deep.svg)](http://badge.fury.io/js/has-own-deep) | ||
# has-own-deep [![NPM version](https://badge.fury.io/js/has-own-deep.svg)](http://badge.fury.io/js/has-own-deep) [![Build Status](https://travis-ci.org/jonschlinkert/has-own-deep.svg)](https://travis-ci.org/jonschlinkert/has-own-deep) | ||
> Returns true if an object has an own, nested property. | ||
> Returns true if an object has an own, nested property using dot notation paths ('a.b.c'). | ||
@@ -15,6 +15,32 @@ ## Install with [npm](npmjs.org) | ||
var hasOwnDeep = require('has-own-deep'); | ||
hasOwnDeep({}); | ||
//=> false | ||
hasOwnDeep({a: 'b'}, 'a'); | ||
//=> true | ||
var obj = {a: {b: {c: 'd'}}}; | ||
hasOwnDeep(obj, 'a'); | ||
//=> true | ||
hasOwnDeep(obj, 'a.b'); | ||
//=> true | ||
hasOwnDeep(obj, 'a.b.c'); | ||
//=> true | ||
hasOwnDeep(obj, 'c'); | ||
//=> false | ||
hasOwnDeep(obj, 'a.c'); | ||
//=> false | ||
hasOwnDeep(obj, 'a.b.d'); | ||
//=> false | ||
``` | ||
## Related projects | ||
{%= related([]) %} | ||
* [set-value](https://github.com/jonschlinkert/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | ||
* [get-value](https://github.com/jonschlinkert/get-value): Use property paths (`a.b.c`) get a nested value from an object. | ||
* [has-value](https://github.com/jonschlinkert/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using object paths. | ||
* [has-any](https://github.com/jonschlinkert/has-any): Returns true if an object has any of the specified keys. | ||
* [has-any-deep](https://github.com/jonschlinkert/has-any-deep): Return true if `key` exists deeply on the given object. | ||
* [any](https://github.com/jonschlinkert/any): Returns `true` if a value exists in the given string, array or object. | ||
@@ -21,0 +47,0 @@ ## Running tests |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4853
70