datum-merge
Version:
Simplified diff and merging for deeply nested objects
17 lines • 739 B
TypeScript
import { Diff } from "./diff-lib/deep-diff";
export type PatchResult<T = any> = {
path: string;
op: "add" | "remove" | "replace";
value?: Readonly<T>;
prev?: any;
};
export declare function diffToPatchLog(differences: readonly Diff<any, any>[], storePrev?: boolean): PatchResult[];
export declare function applyPatchLog(patchLog: PatchResult[], target?: object): object;
export declare function deepPatchLog(lhsObj: {
[key: string]: any;
}, rhsObj: {
[key: string]: any;
}, orderInd?: boolean, storePrev?: boolean): PatchResult[];
export declare function asLodashPath(pointer: string): string[];
export declare function getValueByPointer(document: any, pointer: string): any;
//# sourceMappingURL=patch-low.d.ts.map