1.0.0 • Published 5 years ago

@ts-simple/deep-keys v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

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']  */
1.0.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago