-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjson-diff.types.ts
More file actions
29 lines (25 loc) · 654 Bytes
/
json-diff.types.ts
File metadata and controls
29 lines (25 loc) · 654 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
export type DifferenceStatus = 'added' | 'removed' | 'updated' | 'unchanged' | 'children-updated';
export interface ObjectDifference {
key: string | number
type: 'object'
children: Difference[]
status: DifferenceStatus
oldValue: unknown
value: unknown
}
export interface ValueDifference {
key: string | number
type: 'value'
value: unknown
oldValue: unknown
status: DifferenceStatus
}
export interface ArrayDifference {
key: number | string
type: 'array'
children: Difference[]
status: DifferenceStatus
oldValue: unknown
value: unknown
}
export type Difference = ObjectDifference | ValueDifference | ArrayDifference;