nested-object-to-key-value
Version:
A lightweight utility to flatten nested JavaScript objects into dot-notation key-value pairs and unflatten them back. Perfect for handling complex configurations, form data, or API transformations.
8 lines • 354 B
TypeScript
import type { UnflattenedJson } from "./unflattenJson";
export interface FlattenedPair {
key: string;
value: string;
}
export declare function flattenJson(obj: UnflattenedJson, prefix?: string): FlattenedPair[];
export declare function keyValueArrayToObject(obj: FlattenedPair[]): Record<string, string>;
//# sourceMappingURL=flattenJson.d.ts.map