★ wanayoo — archive 1999 https://github.com/nodejs/node/pull/26927Nouvelle recherche | Portail wanayoo
Skip to content
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

Conversation

Copy link
Member

@BridgeAR BridgeAR commented Mar 26, 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.

@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 or inspect changes are treated as patch but this could
be 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), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the util label Mar 26, 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`.
@BridgeAR BridgeAR force-pushed the improve-util-format-specifiers branch from f59c390 to cca384b Compare Mar 26, 2019
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Mar 26, 2019

@vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt commented Mar 26, 2019

Docs LGTM. Sorry, I cannot think of any better wording for now.

@BridgeAR
Copy link
Member Author

@BridgeAR BridgeAR commented Mar 27, 2019

Copy link
Member

@targos targos left a comment

Maybe use "except" instead of "besides" in the documentation?

@BridgeAR
Copy link
Member Author

@BridgeAR BridgeAR commented Mar 29, 2019

@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).

@BridgeAR BridgeAR added the author ready label Mar 29, 2019
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Mar 29, 2019

@targos
Copy link
Member

@targos targos commented Mar 30, 2019

@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Mar 30, 2019

@BridgeAR
Copy link
Member Author

@BridgeAR BridgeAR commented Apr 4, 2019

Landed in a9bf665 🎉

@BridgeAR BridgeAR closed this Apr 4, 2019
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>
@addaleax addaleax added the semver-major label Aug 27, 2019
@BridgeAR BridgeAR deleted the improve-util-format-specifiers branch Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready semver-major util
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants