Skip to content

Commit e994d6a

Browse 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 <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent c77abf5 commit e994d6a

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

doc/api/buffer.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@ however, subtle incompatibilities between the `Buffer` API and the
164164

165165
In particular:
166166

167-
* While [`TypedArray#slice()`][] creates a copy of part of the `TypedArray`,
168-
[`Buffer#slice()`][`buf.slice()`] creates a view over the existing `Buffer`
167+
* While [`TypedArray.prototype.slice()`][] creates a copy of part of the `TypedArray`,
168+
[`Buffer.prototype.slice()`][`buf.slice()`] creates a view over the existing `Buffer`
169169
without copying. This behavior can be surprising, and only exists for legacy
170-
compatibility. [`TypedArray#subarray()`][] can be used to achieve the behavior
171-
of [`Buffer#slice()`][`buf.slice()`] on both `Buffer`s and other
172-
`TypedArray`s.
170+
compatibility. [`TypedArray.prototype.subarray()`][] can be used to achieve
171+
the behavior of [`Buffer.prototype.slice()`][`buf.slice()`] on both `Buffer`s
172+
and other `TypedArray`s.
173173
* [`buf.toString()`][] is incompatible with its `TypedArray` equivalent.
174174
* A number of methods, e.g. [`buf.indexOf()`][], support additional arguments.
175175

@@ -947,9 +947,9 @@ added: v0.1.90
947947
Copies data from a region of `buf` to a region in `target`, even if the `target`
948948
memory region overlaps with `buf`.
949949

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

954954
```js
955955
// Create two `Buffer` instances.
@@ -1210,7 +1210,7 @@ an integer between 0 and 255.
12101210

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

12151215
```js
12161216
const b = Buffer.from('abcdef');
@@ -1310,7 +1310,7 @@ an integer between 0 and 255.
13101310

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

13151315
```js
13161316
const b = Buffer.from('abcdef');
@@ -1981,7 +1981,7 @@ offset and cropped by the `start` and `end` indices.
19811981
Specifying `end` greater than [`buf.length`][] will return the same result as
19821982
that of `end` equal to [`buf.length`][].
19831983

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

19861986
Modifying the new `Buffer` slice will modify the memory in the original `Buffer`
19871987
because the allocated memory of the two objects overlap.
@@ -3396,13 +3396,13 @@ introducing security vulnerabilities into an application.
33963396
[`ERR_OUT_OF_RANGE`]: errors.md#ERR_OUT_OF_RANGE
33973397
[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
33983398
[`SharedArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer
3399-
[`String#indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf
3400-
[`String#lastIndexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
3399+
[`String.prototype.indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf
3400+
[`String.prototype.lastIndexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf
34013401
[`String.prototype.length`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length
3402-
[`TypedArray#set()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set
3403-
[`TypedArray#slice()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice
3404-
[`TypedArray#subarray()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray
34053402
[`TypedArray.from()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from
3403+
[`TypedArray.prototype.set()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set
3404+
[`TypedArray.prototype.slice()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice
3405+
[`TypedArray.prototype.subarray()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray
34063406
[`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
34073407
[`Uint8Array`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
34083408
[`buf.buffer`]: #buffer_buf_buffer

0 commit comments

Comments
 (0)