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

ryanaghdam/has-key-deep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 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

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