util: use minimal object inspection with %s specifier#26927
Closed
BridgeAR wants to merge 2 commits intonodejs:masterfrom
Closed
util: use minimal object inspection with %s specifier#26927BridgeAR wants to merge 2 commits intonodejs:masterfrom
BridgeAR wants to merge 2 commits intonodejs:masterfrom
Conversation
This improves `util.format()` by returning more meaningful results when using `%s` as specifier and any object as value. Besides that `BigInt` will also be represented with an `n` at the end to indicate that it's of type `BigInt`.
f59c390 to
cca384b
Compare
Collaborator
Contributor
|
Docs LGTM. Sorry, I cannot think of any better wording for now. |
Member
Author
|
@nodejs/util PTAL |
targos
approved these changes
Mar 29, 2019
Member
targos
left a comment
There was a problem hiding this comment.
Maybe use "except" instead of "besides" in the documentation?
Member
Author
|
@targos I updated it as suggested. I also slightly changed the defaults used while inspecting (that will only have influence when inspecting objects that have lots of elements in the most outer object). |
Collaborator
Member
|
@nodejs/util |
Collaborator
ZYSzys
approved these changes
Apr 3, 2019
Member
Author
|
Landed in a9bf665 🎉 |
BridgeAR
added a commit
to BridgeAR/node
that referenced
this pull request
Apr 4, 2019
This improves `util.format()` by returning more meaningful results when using `%s` as specifier and any object as value. Besides that `BigInt` will also be represented with an `n` at the end to indicate that it's of type `BigInt`. PR-URL: nodejs#26927 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This was referenced Apr 23, 2019
This was referenced Apr 23, 2019
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This improves
util.format()by returning more meaningful resultswhen using
%sas specifier and any object as value. Besides thatBigIntwill also be represented with annat the end to indicatethat it's of type
BigInt.@Trott @vsemozhetbyt the documentation does not seem very intuitive
and I fail to find brief words to describe everything properly. It would
be great if you could have a look to suggest improvements.
Most
formatorinspectchanges are treated as patch but this couldbe considered semver-major even though I doubt that it would break anything. I would like to get the opinion of others on that and I'll trigger CITGM to see if anything pops up.
CITGM https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1777/
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes