keys-at-depth
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

keys-at-depth

Returns the keys of an object at a given depth n.

For example,

let details = {
  name: 'myname',
  age: 10,
  subjects: [
    'maths',
    'physics'
  ],
  relations: {
    mom: {
      name: 'mymom'
    }
  }
};

keysAtDepth(details, 0) // ['name', 'age', 'subjects', 'relations']

Readme

Keywords

none

Package Sidebar

Install

npm i keys-at-depth

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

8.15 kB

Total Files

5

Last publish

Collaborators

  • astronomersiva