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

Fill out more of the node:util implementation #1804

Merged
merged 10 commits into from
Mar 22, 2024
Merged

Fill out more of the node:util implementation #1804

merged 10 commits into from
Mar 22, 2024

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Mar 12, 2024

Handful of additional node:util APIs

@jasnell jasnell requested review from a team as code owners March 12, 2024 01:17
@jasnell jasnell changed the title Export TextDecoder/TextEncoder from node:util Fill out more of the node:util implementation Mar 12, 2024
@fhanau
Copy link
Collaborator

fhanau commented Mar 20, 2024

Code looks good to me. Some observations:

  • util.log() is deprecated.
  • util.toUSVString is doc-only deprecated as of doc: deprecate util.toUSVString nodejs/node#49725. Not sure if we want to keep those, but since it's not marked as deprecated in the main documentation we can implement it.
  • deprecations.md in the Node docs also lists util.debug() as deprecated, but that's not reflected in https://nodejs.org/api/util.html#utildebugsection so adding it makes sense to me.
  • deprecate() is a no-op as implemented here, glad we're having a TODO for it.
  • Are we adding tests for this?

@jasnell
Copy link
Member Author

jasnell commented Mar 21, 2024

util.log(), util.toUSVString() are both still fairly common in the wild, so even with deprecation they make sense.

I'll see about adding some tests.

Copy link
Collaborator

@fhanau fhanau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests LGTM, having more would be nice to have but the attack surface of these functions is small so not required. Based on the number of commits consider combining some of them/using squash-merge.

@jasnell jasnell merged commit bfcfe9a into main Mar 22, 2024
10 checks passed
@jasnell jasnell deleted the jsnell/moar-node branch March 22, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants