-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdiff.proto
56 lines (47 loc) · 964 Bytes
/
diff.proto
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
syntax = "proto3";
package DeepDiff;
/* This is a maximally type-safe description of the diffs output by the npm
package deep-diff. The code in deep-diff-wrapper.js converts from and to
the output of deep-diff and these structures. */
message PathItem {
oneof item {
string key = 1;
int32 index = 2;
}
}
message Path {
repeated PathItem items = 1;
}
// kind === 'N'
message NewDiffElement {
// JSON string
string rhs = 1;
}
// kind === 'D'
message DeleteDiffElement {
// JSON string
string lhs = 1;
}
// kind === 'E'
message EditDiffElement {
// JSON strings
string lhs = 1;
string rhs = 2;
}
// kind === 'A'
message ArrayDiffElement {
int32 index = 1;
DiffElement item = 2;
}
message DiffElement {
Path path = 1;
oneof element {
NewDiffElement new = 2;
DeleteDiffElement delete = 3;
EditDiffElement edit = 4;
ArrayDiffElement array = 5;
}
}
message Diff {
repeated DiffElement elements = 1;
}