-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
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
Docs LGTM. Sorry, I cannot think of any better wording for now. |
@nodejs/util PTAL |
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.
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). |
@nodejs/util |
Landed in a9bf665 🎉 |
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 improves
util.format()
by returning more meaningful resultswhen using
%s
as specifier and any object as value. Besides thatBigInt
will also be represented with ann
at 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
format
orinspect
changes 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