@garysui/json-ops
Version:
TypeScript utilities for JSON operations: flatten, diff, apply, and more
21 lines • 721 B
TypeScript
export declare function replaceUndefined<T>(input: T): T;
export declare function restoreUndefined<T>(input: T): T | undefined;
export declare function flat(obj: unknown): Record<string, unknown>[];
export declare function unflat(entries: Record<string, unknown>[]): unknown;
export declare function sortKeys(obj: unknown): unknown;
type DiffOperation = {
type: 'add';
path: string;
value: unknown;
} | {
type: 'remove';
path: string;
} | {
type: 'set';
path: string;
value: unknown;
};
export declare function diff(a: unknown, b: unknown): DiffOperation[];
export declare function apply(input: unknown, operations: DiffOperation[]): unknown;
export {};
//# sourceMappingURL=index.d.ts.map