@terminus/ngx-tools
Version:
[![CircleCI][circle-badge]][circle-link] [![codecov][codecov-badge]][codecov-project] [![semantic-release][semantic-release-badge]][semantic-release] [![MIT License][license-image]][license-url] <br> [![NPM version][npm-version-image]][npm-url] [![Github
13 lines (12 loc) • 520 B
TypeScript
/**
* Helper function to parse an object with deep keys
*
* @param object - An object with key as string or string
* @param keys - A string or array of strings
* @returns String value at the lowest layer or object itself
*
* @example
* objectDeepParse(myObject, ['foo', 'bar']) // Returns: myObject.foo.bar if found
* objectDeepParse(myObject, 'foo.bar') // Returns: myObject.foo.bar if found
*/
export declare function objectDeepParse(object: Record<string, any> | string, keys: string | string[]): any;