@augment-vir/common
Version:
A collection of augments, helpers types, functions, and classes for any JavaScript environment.
16 lines (15 loc) • 466 B
TypeScript
import { type AnyObject, type UnknownObject } from '@augment-vir/core';
/**
* Flattens a nested object into a single-level object.
*
* @category Package : @augment-vir/common
* @example
*
* ```ts
* import {flattenObject} from '@augment-vir/common';
*
* flattenObject({a: 'hello', b: {c: 42, d: {e: true, a: 'bye'}}});
* // {a: 'bye', 'c': 42, 'e': true}
* ```
*/
export declare function flattenObject(originalObject: Readonly<AnyObject>): UnknownObject;