Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cf32483

Browse files
fix: normalized bug
1 parent 1874cc6 commit cf32483

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

‎src/http/json/json.controller.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,24 @@ export class JsonController {
3737
}
3838

3939
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
4658
}
4759

4860
while (jobList.length) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /