Skip to content

mrozio13pl/find-up-keys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

find-up-keys

Find matching values for a given name key in an object.

Install

npm i find-up-keys

Usage

const findUpKeys = require('find-up-keys');

// some random nested object
const obj = {
  title: 'Hello, World!',
  description: 'Hi!',
  info: {
    description: 'more desc',
    tags: ['...'],
    extras: {
      description: null
    }
  }
};

findUpKeys(obj, 'description'); // <= ['Hi!', 'more desc', null]

findUpKeys (object, key)

Find matching values for a key in an object.

object

Type: object

Object to check.

key

Type: string

Keys to find.

License

MIT

About

Find matching values for a given name key in an object.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published