UNPKG

732 BTypeScriptView Raw
1export declare type IJsonPatch = {
2 op: "replace" | "add" | "remove";
3 path: string;
4 value?: any;
5};
6export declare type IReversibleJsonPatch = IJsonPatch & {
7 oldValue: any;
8};
9export declare function splitPatch(patch: IReversibleJsonPatch): [IJsonPatch, IJsonPatch];
10export declare function stripPatch(patch: IReversibleJsonPatch): IJsonPatch;
11/**
12 * escape slashes and backslashes
13 * http://tools.ietf.org/html/rfc6901
14 */
15export declare function escapeJsonPath(str: string): string;
16/**
17 * unescape slashes and backslashes
18 */
19export declare function unescapeJsonPath(str: string): string;
20export declare function joinJsonPath(path: string[]): string;
21export declare function splitJsonPath(path: string): string[];