FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(common): escape replaced value by blastZ · Pull Request #770 · debug-js/debug · GitHub

/ debug Public

fix(common): escape replaced value - #770

Open
blastZ wants to merge 1 commit into
debug-js:masterfrom
blastZ:patch-1
Open

fix(common): escape replaced value#770
blastZ wants to merge 1 commit into
debug-js:masterfrom
blastZ:patch-1

Conversation

blastZ commented Jul 2, 2020

Copy link
Copy Markdown

Something like this log('I like %O', { name: '%sugar%' }); will cause output incorrect.

Something like this `log('I like %O', { name: '%sugar%' });` will cause output incorrect.

Copy link
Copy Markdown

Coverage increased (+0.05%) to 87.739% when pulling d687542 on blastZ:patch-1 into 80ef62a on visionmedia:master.

1 similar comment

Copy link
Copy Markdown

Coverage increased (+0.05%) to 87.739% when pulling d687542 on blastZ:patch-1 into 80ef62a on visionmedia:master.

Qix- commented Jul 2, 2020

Copy link
Copy Markdown
Member

Can you add tests for this, please? I'm not sure which sorts of things this fixes.

blastZ commented Jul 7, 2020

Copy link
Copy Markdown
Author

Can you add tests for this, please? I'm not sure which sorts of things this fixes.

The default formatters will replace %o and %O, so when arguments go to the log function, util.format will get arguments like this ["...'%sugar%'... }", '...']. So if you don't escape the % in the value, util.format will replace %s with the next argument. That's why issue #766 happend.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL