File tree Expand file tree Collapse file tree 2 files changed +85
-85
lines changed Expand file tree Collapse file tree 2 files changed +85
-85
lines changed Original file line number Diff line number Diff line change @@ -4,115 +4,115 @@ Entity diff generator.
44
55de:
66
7- ``` json
7+ ``` javascript
88{
9- "id" : 1 ,
10- " nome" : " Fulano da silva" ,
11- " empresa" : {
12- "id" : 1 ,
13- " nome" : " Algum lugar" ,
14- " cnpj" : " 12345678910"
9+ id : 1 ,
10+ nome: " Fulano da silva" ,
11+ empresa: {
12+ id : 1 ,
13+ nome: " Algum lugar" ,
14+ cnpj: " 12345678910"
1515 },
16- " permissoes" : [
16+ permissoes: [
1717 {
18- "id" : 1 ,
19- " nome" : " ADMINISTRADOR"
18+ id : 1 ,
19+ nome: " ADMINISTRADOR"
2020 },
2121 {
22- "id" : 2 ,
23- " nome" : " USUARIO"
22+ id : 2 ,
23+ nome: " USUARIO"
2424 }
2525 ]
2626}
2727```
2828
2929para:
3030
31- ``` json
31+ ``` javascript
3232{
33- "id" : 1 ,
34- " nome" : " Fulano" ,
35- " empresa" : {
36- "id" : 2 ,
37- " nome" : " Outro lugar" ,
38- " cnpj" : " 10987654321"
33+ id : 1 ,
34+ nome: " Fulano" ,
35+ empresa: {
36+ id : 2 ,
37+ nome: " Outro lugar" ,
38+ cnpj: " 10987654321"
3939 },
40- " permissoes" : [
40+ permissoes: [
4141 {
42- "id" : 1 ,
43- " nome" : " SUPER_USER"
42+ id : 1 ,
43+ nome: " SUPER_USER"
4444 },
4545 {
46- "id" : 4 ,
47- " nome" : " PROGRAMADOR"
46+ id : 4 ,
47+ nome: " PROGRAMADOR"
4848 }
4949 ]
5050}
5151```
5252
5353** diff**
5454
55- ``` json
55+ ``` javascript
5656[
57- {
58- "key" : " nome" ,
59- "from" : " Fulano da silva" ,
60- "to" : " Fulano"
61- },
62- {
63- "key" : " empresa" ,
64- "type" : " EDITADO" ,
65- "details" : [
66- {
67- "key" : " nome" ,
68- "from" : " Algum lugar" ,
69- "to" : " Outro lugar"
70- },
71- {
72- "key" : " cnpj" ,
73- "from" : " 12345678910" ,
74- "to" : " 10987654321"
75- }
57+ {
58+ key: " nome" ,
59+ from: " Fulano da silva" ,
60+ to: " Fulano"
61+ },
62+ {
63+ key: " empresa" ,
64+ type: " EDITADO" ,
65+ details: [
66+ {
67+ key: " nome" ,
68+ from: " Algum lugar" ,
69+ to: " Outro lugar"
70+ },
71+ {
72+ key: " cnpj" ,
73+ from: " 12345678910" ,
74+ to: " 10987654321"
75+ }
76+ ]
77+ },
78+ {
79+ key: " permissoes" ,
80+ type: " LISTA" ,
81+ details: [
82+ {
83+ key: " ADMINISTRADOR" ,
84+ type: " EDITADO" ,
85+ details: [
86+ {
87+ key: " nome" ,
88+ from: " ADMINISTRADOR" ,
89+ to: " SUPER_USER"
90+ }
7691 ]
77- },
78- {
79- "key" : " permissoes" ,
80- "type" : " LISTA" ,
81- "details" : [
82- {
83- "key" : " ADMINISTRADOR" ,
84- "type" : " EDITADO" ,
85- "details" : [
86- {
87- "key" : " nome" ,
88- "from" : " ADMINISTRADOR" ,
89- "to" : " SUPER_USER"
90- }
91- ]
92- },
93- {
94- "key" : " USUARIO" ,
95- "type" : " NOVO" ,
96- "details" : [
97- {
98- "key" : " nome" ,
99- "from" : null ,
100- "to" : " USUARIO"
101- }
102- ]
103- },
104- {
105- "key" : " PROGRAMADOR" ,
106- "type" : " REMOVIDO" ,
107- "details" : [
108- {
109- "key" : " nome" ,
110- "from" : " PROGRAMADOR" ,
111- "to" : null
112- }
113- ]
114- }
92+ },
93+ {
94+ key: " PROGRAMADOR" ,
95+ type: " NOVO" ,
96+ details: [
97+ {
98+ key: " nome" ,
99+ from: null ,
100+ to: " PROGRAMADOR"
101+ }
115102 ]
116- }
103+ },
104+ {
105+ key: " USUARIO" ,
106+ type: " REMOVIDO" ,
107+ details: [
108+ {
109+ key: " nome" ,
110+ from: " USUARIO" ,
111+ to: null
112+ }
113+ ]
114+ },
115+ ]
116+ }
117117]
118118```
Original file line number Diff line number Diff line change @@ -97,8 +97,8 @@ var Audit = /** @class */ (function () {
9797 from = utils_1 . copySkeleton ( from ) ;
9898 }
9999 var modified = this . findModifiedDiffs ( from , to , key ) ;
100- var add = this . findDiffsFromLeftToRight ( from , to , key , DiffType . NEW ) ;
101- var remove = this . findDiffsFromLeftToRight ( to , from , key , DiffType . REMOVED ) ;
100+ var add = this . findDiffsFromLeftToRight ( to , from , key , DiffType . NEW ) ;
101+ var remove = this . findDiffsFromLeftToRight ( from , to , key , DiffType . REMOVED ) ;
102102 return __spreadArrays ( modified , add , remove ) ;
103103 } ;
104104 Audit . prototype . findModifiedDiffs = function ( right , left , key ) {
You can’t perform that action at this time.
0 commit comments