Open ChALkeR opened 6 years ago
Use Buffer.from when it's available instead of new Bufer(string)
Buffer.from
new Bufer(string)
Fixes: https://github.com/npm/fstream/issues/60 Refs: https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor Tracking: https://github.com/nodejs/node/issues/19079
Given that this is a highly popular module and that Buffer constructor was used in a single place, I decided to add a minimal polyfill in-place (like I do in other similar situations) instead of adding a dependnecy.
/cc @zkat
Use
Buffer.from
when it's available instead ofnew Bufer(string)
Fixes: https://github.com/npm/fstream/issues/60 Refs: https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor Tracking: https://github.com/nodejs/node/issues/19079
Given that this is a highly popular module and that Buffer constructor was used in a single place, I decided to add a minimal polyfill in-place (like I do in other similar situations) instead of adding a dependnecy.
/cc @zkat