Skip to content

Commit

Permalink
fix: stringify object field names
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jul 13, 2020
1 parent 9d9f360 commit 60840a9
Show file tree
Hide file tree
Showing 7 changed files with 670 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"program": "${workspaceFolder}/node_modules/.bin/jest",
"cwd": "${workspaceFolder}/core/webpack-compile",
"args": [
"example-stories",
"subcomponents",
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
Expand Down
6 changes: 5 additions & 1 deletion core/instrument/src/misc/stringify-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export const stringifyObject = (
.map(key => {
return typeof val[key] === 'function'
? null
: `${key}: ${stringifyObject(val[key], sep, depth + 1)}`;
: `"${jsStringEscape(key)}": ${stringifyObject(
val[key],
sep,
depth + 1,
)}`;
})
.filter(v => v)}
}
Expand Down
Loading

0 comments on commit 60840a9

Please sign in to comment.