find-up-keys
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i find-up-keys

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

3.63 kB

Total Files

5

Last publish

Collaborators

  • mrozio