8000 GitHub - jmont/has-key-deep: Deep-search objects for keys in JavaScript objects. Keys can be searched by providing an array of keys, or using a dot-notiation.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Deep-search objects for keys in JavaScript objects. Keys can be searched by providing an array of keys, or using a dot-notiation.

License

Notifications You must be signed in to change notification settings

jmont/has-key-deep

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hasKeyDeep

Build Status

Deep-search objects for keys. Keys can be searched by providing an array of keys, or using a dot-notiation.

Examples

Complete application

hasKeyDeep({ a: { b: { c: 1 } } }, 'a.b.c') => true
hasKeyDeep({ a: { b: { c: 1 } } }, ['a', 'b', 'c']) => true
hasKeyDeep({ a: { b: { c: 1 } } }, 'a.b.c.d') => true
hasKeyDeep({ a: { b: { c: 1 } } }, 'a.c') => false
hasKeyDeep({}, 'a') => false

Partial application

var hasABC = hasKeyDeep('a.b.c');
hasAbc({a: { b: { c: 1 } } }) => true
hasAbc({a: 1 }) => false

Changelog

  • v2.0.0: Switches order of arguments, provides curried function if only one is supplied. (3/14/2016)
  • v1.0.1: Updates build status in README (3/3/2016)
  • v1.0.0: Adds argument validation; mocha tests (3/2/2016)
  • v0.0.3: Updated repository field in package.json (2/1/2015)
  • v0.0.2: Minor refactoring for better readability (1/22/2015)
  • v0.0.1: Initial release (1/22/2015)

About

Deep-search objects for keys in JavaScript objects. Keys can be searched by providing an array of keys, or using a dot-notiation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%
0