File tree 1 file changed +18
-6
lines changed
1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,24 @@ export class JsonController {
37
37
}
38
38
39
39
const normalizedData = data => {
40
- data = JSON . stringify ( data )
41
- data = data
42
- . replace ( / \# / g, '' ) // replace "#" operation arg
43
- . replace ( / \[ \] / g, '' )
44
-
45
- return JSON . parse ( data )
40
+ Object . keys ( data ) . forEach ( key => {
41
+ const normalizedKey = key
42
+ . replace ( / \# / g, '' ) // replace "#" operation arg
43
+ . replace ( / \[ \] / g, '' )
44
+ if ( normalizedKey !== key ) {
45
+ const tmp = data [ key ]
46
+ data [ normalizedKey ] = tmp
47
+ delete data [ key ]
48
+ if ( typeof data [ normalizedKey ] === 'object' ) {
49
+ normalizedData ( data [ normalizedKey ] )
50
+ }
51
+ } else {
52
+ if ( typeof data [ key ] === 'object' ) {
53
+ normalizedData ( data [ key ] )
54
+ }
55
+ }
56
+ } )
57
+ return data
46
58
}
47
59
48
60
while ( jobList . length ) {
You can’t perform that action at this time.
0 commit comments