Skip to main content

Function: getDeepObjectKeys()

getDeepObjectKeys(obj: object, options?: GetDeepObjectKeysOptions): string[]

Defined in: getDeepObjectKeys.ts:14

Flattens an object to a list of its keys, traversing deeply into nested objects and arrays of objects.

Parameters​

ParameterTypeDescription
objobjectThe object of which to deeply retrieve its keys
options?GetDeepObjectKeysOptionsThe options with which to customize the output of this function

Returns​

string[]

An array of strings holding the keys of the object

Note​

By default Nested array values are flattened to arrayKey.${index}.subKey. This can be changed to arrayKey[${index}].subKey by setting options.arrayKeysIndexStyle to 'braces-with-dot'. Or it can also be changed to arrayKey[${index}]subKey by setting options.arrayKeysIndexStyle to 'braces'.