We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1874cc6 commit cf32483Copy full SHA for cf32483
1 file changed
src/http/json/json.controller.ts
@@ -37,12 +37,24 @@ export class JsonController {
37
}
38
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)
+ Object.keys(data).forEach(key => {
+ const normalizedKey = key
+ .replace(/\#/g, '') // replace "#" operation arg
+ .replace(/\[\]/g, '')
+ if (normalizedKey !== key) {
+ 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
58
59
60
while (jobList.length) {
0 commit comments