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
util: use minimal object inspection with %s specifier #26927
Closed
Closed
Conversation
This file contains 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
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
|
Docs LGTM. Sorry, I cannot think of any better wording for now. |
|
@nodejs/util PTAL |
targos
approved these changes
Mar 29, 2019
Maybe use "except" instead of "besides" in the documentation?
|
@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). |
ZYSzys
approved these changes
Apr 3, 2019
|
Landed in a9bf665 |
BridgeAR
added a commit
to BridgeAR/node
that referenced
this issue
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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
semver-major
PRs that contain breaking changes and should be released in the next major version.
util
Issues and PRs related to the built-in util module.
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.
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