From 1878a25694aec026cb1fee0ae4c25be36569e556 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Mon, 11 Apr 2022 00:34:11 +0200 Subject: [PATCH] doc: remove unneeded new in Buffer example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/42682 Reviewed-By: Mestery Reviewed-By: Antoine du Hamel Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Tobias Nießen Reviewed-By: Rich Trott Reviewed-By: Darshan Sen Reviewed-By: Luigi Pinca Reviewed-By: Akhil Marsonya --- doc/api/buffer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index f27ab14dcc9884..581cb20912d399 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -1512,7 +1512,7 @@ a `Buffer` is that in this case one needs to specify the `byteOffset` correctly: import { Buffer } from 'buffer'; // Create a buffer smaller than `Buffer.poolSize`. -const nodeBuffer = new Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); +const nodeBuffer = Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); // When casting the Node.js Buffer to an Int8Array, use the byteOffset // to refer only to the part of `nodeBuffer.buffer` that contains the memory @@ -1524,7 +1524,7 @@ new Int8Array(nodeBuffer.buffer, nodeBuffer.byteOffset, nodeBuffer.length); const { Buffer } = require('buffer'); // Create a buffer smaller than `Buffer.poolSize`. -const nodeBuffer = new Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); +const nodeBuffer = Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); // When casting the Node.js Buffer to an Int8Array, use the byteOffset // to refer only to the part of `nodeBuffer.buffer` that contains the memory