-
Notifications
You must be signed in to change notification settings - Fork 70
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
Encode opening brackets in contextDump helper #94
Encode opening brackets in contextDump helper #94
Conversation
@@ -178,6 +178,8 @@ var helpers = { | |||
else { | |||
dump = JSON.stringify(context.stack.head, jsonFilter, 2); | |||
} | |||
// encode opening brackets | |||
dump = dump.replace(/</g, '\\u003c'); | |||
if (to === 'console') { |
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.
Should this be part of jsonFilter function?
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.
we prolly only need this in the else case. console.log AFAIK is pretty safe.
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.
@kate2753 the jsonFilter function acts on each key value pair, so I figure this is a bit more performant.
@jimmyhchan why's that, couldn't the current context still have opening brackets?
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.
console.logging with open brackets is not an issue. chunk.write with open brackets is.
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.
Ahh I see, you mean the else with chunk.write. Yeah that makes sense.
b4940ae
to
84951a6
Compare
84951a6
to
03cd65f
Compare
bump |
Encode opening brackets in contextDump helper
...slow your roll |
No description provided.