-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Create Buffer.copy static method
#61168
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61168 +/- ##
==========================================
- Coverage 88.53% 88.52% -0.01%
==========================================
Files 703 704 +1
Lines 208546 208797 +251
Branches 40217 40283 +66
==========================================
+ Hits 184634 184840 +206
- Misses 15926 15944 +18
- Partials 7986 8013 +27
🚀 New features to boost your workflow:
|
|
There's been some efforts (notably by @jasnell) to bring the native JS buffer/TA types into alignment with Buffer, at least for major use cases. See also #41588. Adding new functionality to Buffer seems contrary to that effort. I'm not necessarily opposed, but it's probably worth thinking through what it would look like for this functionality to exist in pure JS, or alternatively what alternatives would exist in JS such that it would enable people to migrate away from use of Buffer. |
|
@bakkot I created and verified with benchmarks, and you're right. The standard Web API Since the standard approach is both more idiomatic and more performant, there’s no reason to add more surface area to Buffer. I guess we can close this PR |
Fixes #53700