Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 183f0c3

Browse filesBrowse files
deokjinkimtargos
authored andcommitted
doc: change offset of example in Buffer.copyBytesFrom
Actual output is different from expected output if offset is 0. Plus, removed unused importing `Buffer`. PR-URL: #47606 Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com>
1 parent 9d3768e commit 183f0c3
Copy full SHA for 183f0c3

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎doc/api/buffer.md‎

Copy file name to clipboardExpand all lines: doc/api/buffer.md
+3-3Lines changed: 3 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ contained by the `Blob` is copied only when the `arrayBuffer()` or `text()`
581581
methods are called.
582582

583583
```mjs
584-
import { Blob, Buffer } from 'node:buffer';
584+
import { Blob } from 'node:buffer';
585585
import { setTimeout as delay } from 'node:timers/promises';
586586

587587
const blob = new Blob(['hello there']);
@@ -608,7 +608,7 @@ blob.text().then(console.log);
608608
```
609609

610610
```cjs
611-
const { Blob, Buffer } = require('node:buffer');
611+
const { Blob } = require('node:buffer');
612612
const { setTimeout: delay } = require('node:timers/promises');
613613

614614
const blob = new Blob(['hello there']);
@@ -1073,7 +1073,7 @@ Copies the underlying memory of `view` into a new `Buffer`.
10731073

10741074
```js
10751075
const u16 = new Uint16Array([0, 0xffff]);
1076-
const buf = Buffer.copyBytesFrom(u16, 0, 1);
1076+
const buf = Buffer.copyBytesFrom(u16, 1, 1);
10771077
u16[1] = 0;
10781078
console.log(buf.length); // 2
10791079
console.log(buf[0]); // 255

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.