mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
21 lines
618 B
TypeScript
21 lines
618 B
TypeScript
//#region src/object/flatten.d.ts
|
|
/**
|
|
* Flattens nested object values into dot-separated keys.
|
|
*
|
|
* @param object - The object to flatten.
|
|
* @param options - Options controlling the flattened key path.
|
|
* @returns A new object containing the flattened values.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* flatten({ buttons: { play: 'Play' } });
|
|
* // { 'buttons.play': 'Play' }
|
|
* ```
|
|
*/
|
|
interface FlattenOptions {
|
|
prefix?: string;
|
|
}
|
|
declare function flatten(object: Record<string, unknown>, options?: FlattenOptions): Record<string, unknown>;
|
|
//#endregion
|
|
export { FlattenOptions, flatten };
|
|
//# sourceMappingURL=flatten.d.ts.map
|