-
Notifications
You must be signed in to change notification settings - Fork 289
[ACTVTNS-387] JSON Decode Error #3368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -270,8 +270,14 @@ registerDirective('@json', (opts, payload) => { | |||||||||
| return JSON.stringify(value) | ||||||||||
| } else if (opts.mode === 'decode') { | ||||||||||
| if (typeof value === 'string') { | ||||||||||
| return JSON.parse(value) | ||||||||||
| //Placing this in a try-catch to safely handle any primiative values that are put in the JSON.parse | ||||||||||
|
||||||||||
| //Placing this in a try-catch to safely handle any primiative values that are put in the JSON.parse | |
| //Placing this in a try-catch to safely handle any primitive values that are put in the JSON.parse |
Outdated
Copilot
AI
Oct 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should follow standard formatting with a space after the double slashes: // Placing this in a try-catch... Additionally, consider making the comment more precise about what primitive values are being handled (e.g., 'non-JSON strings').
| //Placing this in a try-catch to safely handle any primiative values that are put in the JSON.parse | |
| // Placing this in a try-catch to safely handle non-JSON strings or primitive values that may cause JSON.parse to throw |
Uh oh!
There was an error while loading. Please reload this page.