html-docx-js-typescript icon indicating copy to clipboard operation
html-docx-js-typescript copied to clipboard

convert new Buffer() to Buffer.from()

Open edjw opened this issue 2 years ago • 0 comments

This PR changes two instances of new Buffer() to use Buffer.from() instead

Using new Buffer() in src/internal.ts causes the following deprecation warning.

(node:5153) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Link to information about the deprecation on Node's docs: https://nodejs.org/api/buffer.html#buffer_new_buffer_string_encoding

edjw avatar Feb 06 '23 12:02 edjw