-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1-origin.ts
More file actions
52 lines (49 loc) · 1007 Bytes
/
1-origin.ts
File metadata and controls
52 lines (49 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { CustomizedDiffPatch } from '../diff/diff'
import {
v1,
v2,
v3,
v4,
v5,
v6,
v7,
} from './objects'
export interface ISnapshotOption {
old: any
new: any
}
export const snapshot = (option: ISnapshotOption) => {
return CustomizedDiffPatch.diff(option.old, option.new)
}
export const originTest = async () => {
const diff1 = snapshot({
old: v1,
new: v2,
})
console.log('DIFF v1->v2', diff1)
const diff2 = snapshot({
old: v2,
new: v3,
})
console.log('DIFF v2->v3', diff2)
const diff3 = snapshot({
old: v3,
new: v4,
})
console.log('DIFF v3->v4', diff3)
const diff4 = snapshot({
old: v4,
new: v5,
})
console.log('DIFF v4->v5', diff4)
const diff5 = snapshot({
old: v5,
new: v6,
})
console.log('DIFF v5->v6', diff5)
const diff6 = snapshot({
old: v6,
new: v7,
})
console.log('DIFF v6->v7', diff6)
}