-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.ts
98 lines (96 loc) · 1.41 KB
/
test.ts
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import {diff} from './src/lib/Obj'
const base = {
name: 'joel',
age: '41',
hobbies: ['coding', 'rpg', 'dancing'],
work: {
name: 'unit4',
years: 14,
},
family: [
{
name: 'anne',
age: '39',
hobbies: ['yoga', 'dancing', 'gardening'],
work: {
name: 'amatango',
years: 8,
},
},
{
name: 'joshua',
age: '7',
hobbies: ['lego', 'minecraft', 'reading'],
work: {
name: 'school',
years: 1,
},
},
{
name: 'eliah',
age: '5',
hobbies: ['ninjago', 'acrobatics', 'lego'],
work: {
name: 'kindergarden',
years: 4,
},
},
{
name: 'Emelie',
age: '2',
hobbies: ['hoppa'],
work: {
name: 'kindergarden',
years: 1,
},
}
]
}
const target = {
name: 'Joel',
age: '41',
hobbies: ['coding', 'rpg', 'dancing'],
work: {
name: 'unit4',
years: 15,
},
family: [
{
name: 'Anne',
age: '39',
hobbies: ['yoga', 'dancing', 'gardening', 'riding'],
work: {
name: 'amatango',
years: 8,
},
},
{
name: 'Joshua',
age: '7',
hobbies: ['lego', 'minecraft', 'reading'],
work: {
name: 'school',
years: 1,
},
},
{
name: 'Elia',
age: '5',
hobbies: ['ninjago', 'acrobatics', 'lego'],
work: {
name: 'preschool',
years: 4,
},
},
{
name: 'Emelie',
age: '2',
hobbies: ['hoppa'],
work: {
name: 'kindergarden',
years: 1,
},
}
]
}
console.log("P", diff(target, base))