@ts-simple/deep-keys
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

deep-keys

Build Status Coverage Status

npm npm bundle size (scoped version) NPM

Simple function to return keys in object, even nested objects.

Warning: Huge object should return 'Maximum call stack size exceeded'

API

  • deepObject(object:Object) => string[];

Usage

Simple Object

import {deepKeys} from '@ts-simple/deep-keys'

const object = { a: 1, b: 2 };
console.log(deepKeys(object));

/*  Expected result same as Object.keys => ['a', 'b']  */

Nested Objects

import {deepKeys} from '@ts-simple/deep-keys'

const object = { a:  {aa: 1, bb: 2} , b: 2 };
console.log(deepKeys(object));

/*  Expected result => ['a.aa', 'a.bb', 'b']  */

Package Sidebar

Install

npm i @ts-simple/deep-keys

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

4.48 kB

Total Files

6

Last publish

Collaborators

  • arturo.silvelo