Skip to content

Commit 12998ea

Browse files
committed
refactor(json-patch-diff): 💡 rename Diff to JsonPatchDiff
1 parent 68b8b27 commit 12998ea

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/json-patch-diff/Diff.ts renamed to src/json-patch-diff/JsonPatchDiff.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as line from '../util/diff/line';
44
import {structHash} from '../json-hash';
55
import type {Operation} from '../json-patch/codec/json/types';
66

7-
export class Diff {
7+
export class JsonPatchDiff {
88
protected patch: Operation[] = [];
99

1010
protected diffVal(path: string, src: unknown, dst: unknown): void {

src/json-patch-diff/__tests__/util.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import {Diff} from '../Diff';
1+
import {JsonPatchDiff} from '../JsonPatchDiff';
22
import {applyPatch} from '../../json-patch';
33

44
export const assertDiff = (src: unknown, dst: unknown) => {
55
const srcNested = {src};
6-
const patch1 = new Diff().diff('/src', src, dst);
6+
const patch1 = new JsonPatchDiff().diff('/src', src, dst);
77
// console.log(src);
88
// console.log(patch1);
99
// console.log(dst);
1010
const {doc: res} = applyPatch(srcNested, patch1, {mutate: false});
1111
// console.log(res);
1212
expect(res).toEqual({src: dst});
13-
const patch2 = new Diff().diff('/src', (res as any)['src'], dst);
13+
const patch2 = new JsonPatchDiff().diff('/src', (res as any)['src'], dst);
1414
// console.log(patch2);
1515
expect(patch2.length).toBe(0);
1616
};

0 commit comments

Comments
 (0)