JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 130791
  • Score
    100M100P100Q162184F
  • License MIT

Creates an array composed of the own enumerable property names(including nested) of an object.

Package Exports

  • deep-keys

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (deep-keys) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

deep-keys

Creates an array composed of the own enumerable property names(including nested) of an object.

Install

$ npm install --save deep-keys

Usage

var deepKeys = require('deep-keys');

var obj1 = {
  a: 1,
  b: { c: 1 },
  c: { d: { e: 1 }, f: 1 },
  d: { e: { f: { g: 1, h: 2 } } },
  e: 2,
  f: { g: [] }
};
deepKeys(obj1);
//=> ['a', 'b.c', 'c.d.e', 'c.f', 'd.e.f.g', 'd.e.f.h', 'e', 'f.g']

var obj2 = {
  type: 'customer',
  details: {
    name: 'Ariel', age: 26, address: { city: 'Tel Aviv', country: 'Israel' }
  },
  isActive: true
};
deepKeys(obj2);
//=> ['type', 'details.name', 'details.age', 'details.address.city', 'details.address.country', 'isActive']

License

MIT © Ariel Mashraki