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 2eef587

Browse filesBrowse files
VoltrexKeyvatargos
authored andcommitted
doc: use foo.prototype.bar notation in buffer.md
Most of the documentation uses `foo.prototype.bar` notation instead of `foo#bar` notation, this commit apply the former in `buffer.md`. PR-URL: #38032 Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent eb8f5ce commit 2eef587
Copy full SHA for 2eef587

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎doc/api/buffer.md‎

Copy file name to clipboardExpand all lines: doc/api/buffer.md
+16-16Lines changed: 16 additions & 16 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ however, subtle incompatibilities between the `Buffer` API and the
176176

177177
In particular:
178178

179-
* While [`TypedArray#slice()`][] creates a copy of part of the `TypedArray`,
180-
[`Buffer#slice()`][`buf.slice()`] creates a view over the existing `Buffer`
179+
* While [`TypedArray.prototype.slice()`][] creates a copy of part of the `TypedArray`,
180+
[`Buffer.prototype.slice()`][`buf.slice()`] creates a view over the existing `Buffer`
181181
without copying. This behavior can be surprising, and only exists for legacy
182-
compatibility. [`TypedArray#subarray()`][] can be used to achieve the behavior
183-
of [`Buffer#slice()`][`buf.slice()`] on both `Buffer`s and other
184-
`TypedArray`s.
182+
compatibility. [`TypedArray.prototype.subarray()`][] can be used to achieve
183+
the behavior of [`Buffer.prototype.slice()`][`buf.slice()`] on both `Buffer`s
184+
and other `TypedArray`s.
185185
* [`buf.toString()`][] is incompatible with its `TypedArray` equivalent.
186186
* A number of methods, e.g. [`buf.indexOf()`][], support additional arguments.
187187

@@ -1086,9 +1086,9 @@ added: v0.1.90
10861086
Copies data from a region of `buf` to a region in `target`, even if the `target`
10871087
memory region overlaps with `buf`.
10881088

1089-
[`TypedArray#set()`][] performs the same operation, and is available for all
1090-
TypedArrays, including Node.js `Buffer`s, although it takes different
1091-
function arguments.
1089+
[`TypedArray.prototype.set()`][] performs the same operation, and is available
1090+
for all TypedArrays, including Node.js `Buffer`s, although it takes
1091+
different function arguments.
10921092

10931093
```js
10941094
// Create two `Buffer` instances.
@@ -1349,7 +1349,7 @@ an integer between 0 and 255.
13491349

13501350
If `byteOffset` is not a number, it will be coerced to a number. If the result
13511351
of coercion is `NaN` or `0`, then the entire buffer will be searched. This
1352-
behavior matches [`String#indexOf()`][].
1352+
behavior matches [`String.prototype.indexOf()`][].
13531353

13541354
```js
13551355
const b = Buffer.from('abcdef');
@@ -1449,7 +1449,7 @@ an integer between 0 and 255.
14491449

14501450
If `byteOffset` is not a number, it will be coerced to a number. Any arguments
14511451
that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer.
1452-
This behavior matches [`String#lastIndexOf()`][].
1452+
This behavior matches [`String.prototype.lastIndexOf()`][].
14531453

14541454
```js
14551455
const b = Buffer.from('abcdef');
@@ -2136,7 +2136,7 @@ offset and cropped by the `start` and `end` indices.
21362136
Specifying `end` greater than [`buf.length`][] will return the same result as
21372137
that of `end` equal to [`buf.length`][].
21382138

2139-
This method is inherited from [`TypedArray#subarray()`][].
2139+
This method is inherited from [`TypedArray.prototype.subarray()`][].
21402140

21412141
Modifying the new `Buffer` slice will modify the memory in the original `Buffer`
21422142
because the allocated memory of the two objects overlap.
@@ -3574,13 +3574,13 @@ introducing security vulnerabilities into an application.
35743574
[`ERR_OUT_OF_RANGE`]: errors.md#ERR_OUT_OF_RANGE
35753575
[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
35763576
[`SharedArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer
3577-
[`String#indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf
3578-
[`String#lastIndexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
3577+
[`String.prototype.indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf
3578+
[`String.prototype.lastIndexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
35793579
[`String.prototype.length`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length
3580-
[`TypedArray#set()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set
3581-
[`TypedArray#slice()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice
3582-
[`TypedArray#subarray()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray
35833580
[`TypedArray.from()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from
3581+
[`TypedArray.prototype.set()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set
3582+
[`TypedArray.prototype.slice()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice
3583+
[`TypedArray.prototype.subarray()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray
35843584
[`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
35853585
[`Uint8Array`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
35863586
[`buf.buffer`]: #buffer_buf_buffer

0 commit comments

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