Skip to content

Commit b229912

Browse files
TrottMylesBorins
authored andcommitted
doc: do not announce obvious examples
Remove "Examples:" labels that announce things that are clearly examples. PR-URL: #19270 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent 072adfe commit b229912

File tree

1 file changed

+0
-72
lines changed

1 file changed

+0
-72
lines changed

doc/api/buffer.md

-72
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ resized.
2222
The `Buffer` class is a global within Node.js, making it unlikely that one
2323
would need to ever use `require('buffer').Buffer`.
2424

25-
Examples:
26-
2725
```js
2826
// Creates a zero-filled Buffer of length 10.
2927
const buf1 = Buffer.alloc(10);
@@ -489,8 +487,6 @@ changes:
489487
Creates a new `Buffer` containing the given JavaScript string `string`. If
490488
provided, the `encoding` parameter identifies the character encoding of `string`.
491489

492-
Examples:
493-
494490
```js
495491
const buf1 = new Buffer('this is a tést');
496492

@@ -896,8 +892,6 @@ added: v5.10.0
896892
Creates a new `Buffer` containing the given JavaScript string `string`. If
897893
provided, the `encoding` parameter identifies the character encoding of `string`.
898894

899-
Examples:
900-
901895
```js
902896
const buf1 = Buffer.from('this is a tést');
903897

@@ -1052,8 +1046,6 @@ Comparison is based on the actual sequence of bytes in each `Buffer`.
10521046
* `1` is returned if `target` should come *before* `buf` when sorted.
10531047
* `-1` is returned if `target` should come *after* `buf` when sorted.
10541048

1055-
Examples:
1056-
10571049
```js
10581050
const buf1 = Buffer.from('ABC');
10591051
const buf2 = Buffer.from('BCD');
@@ -1083,8 +1075,6 @@ The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`
10831075
arguments can be used to limit the comparison to specific ranges within `target`
10841076
and `buf` respectively.
10851077

1086-
Examples:
1087-
10881078
```js
10891079
const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
10901080
const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
@@ -1196,8 +1186,6 @@ changes:
11961186
Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,
11971187
`false` otherwise.
11981188

1199-
Examples:
1200-
12011189
```js
12021190
const buf1 = Buffer.from('ABC');
12031191
const buf2 = Buffer.from('414243', 'hex');
@@ -1277,8 +1265,6 @@ added: v5.3.0
12771265

12781266
Equivalent to [`buf.indexOf() !== -1`][`buf.indexOf()`].
12791267

1280-
Examples:
1281-
12821268
```js
12831269
const buf = Buffer.from('this is a buffer');
12841270

@@ -1334,8 +1320,6 @@ If `value` is:
13341320
* a number, `value` will be interpreted as an unsigned 8-bit integer
13351321
value between `0` and `255`.
13361322

1337-
Examples:
1338-
13391323
```js
13401324
const buf = Buffer.from('this is a buffer');
13411325

@@ -1441,8 +1425,6 @@ changes:
14411425
Identical to [`buf.indexOf()`], except `buf` is searched from back to front
14421426
instead of front to back.
14431427

1444-
Examples:
1445-
14461428
```js
14471429
const buf = Buffer.from('this buffer is a buffer');
14481430

@@ -1535,8 +1517,6 @@ can result in undefined and inconsistent behavior. Applications that wish to
15351517
modify the length of a `Buffer` should therefore treat `length` as read-only and
15361518
use [`buf.slice()`] to create a new `Buffer`.
15371519

1538-
Examples:
1539-
15401520
```js
15411521
let buf = Buffer.allocUnsafe(10);
15421522

@@ -1577,8 +1557,6 @@ little endian).
15771557
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
15781558
the resulting behavior is undefined.
15791559

1580-
Examples:
1581-
15821560
```js
15831561
const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
15841562

@@ -1613,8 +1591,6 @@ little endian).
16131591
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
16141592
the resulting behavior is undefined.
16151593

1616-
Examples:
1617-
16181594
```js
16191595
const buf = Buffer.from([1, 2, 3, 4]);
16201596

@@ -1648,8 +1624,6 @@ the resulting behavior is undefined.
16481624

16491625
Integers read from a `Buffer` are interpreted as two's complement signed values.
16501626

1651-
Examples:
1652-
16531627
```js
16541628
const buf = Buffer.from([-1, 5]);
16551629

@@ -1682,8 +1656,6 @@ the resulting behavior is undefined.
16821656

16831657
Integers read from a `Buffer` are interpreted as two's complement signed values.
16841658

1685-
Examples:
1686-
16871659
```js
16881660
const buf = Buffer.from([0, 5]);
16891661

@@ -1716,8 +1688,6 @@ the resulting behavior is undefined.
17161688

17171689
Integers read from a `Buffer` are interpreted as two's complement signed values.
17181690

1719-
Examples:
1720-
17211691
```js
17221692
const buf = Buffer.from([0, 0, 0, 5]);
17231693

@@ -1749,8 +1719,6 @@ bits of accuracy.
17491719
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
17501720
the resulting behavior is undefined.
17511721

1752-
Examples:
1753-
17541722
```js
17551723
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
17561724

@@ -1778,8 +1746,6 @@ Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
17781746
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
17791747
the resulting behavior is undefined.
17801748

1781-
Examples:
1782-
17831749
```js
17841750
const buf = Buffer.from([1, -2]);
17851751

@@ -1810,8 +1776,6 @@ returns little endian).
18101776
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
18111777
the resulting behavior is undefined.
18121778

1813-
Examples:
1814-
18151779
```js
18161780
const buf = Buffer.from([0x12, 0x34, 0x56]);
18171781

@@ -1848,8 +1812,6 @@ specified endian format (`readUInt32BE()` returns big endian,
18481812
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
18491813
the resulting behavior is undefined.
18501814

1851-
Examples:
1852-
18531815
```js
18541816
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
18551817

@@ -1881,8 +1843,6 @@ bits of accuracy.
18811843
Setting `noAssert` to `true` allows `offset` to be beyond the end of `buf`, but
18821844
the resulting behavior is undefined.
18831845

1884-
Examples:
1885-
18861846
```js
18871847
const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
18881848

@@ -1949,8 +1909,6 @@ console.log(buf2.toString('ascii', 0, buf2.length));
19491909
Specifying negative indexes causes the slice to be generated relative to the
19501910
end of `buf` rather than the beginning.
19511911

1952-
Examples:
1953-
19541912
```js
19551913
const buf = Buffer.from('buffer');
19561914

@@ -1977,8 +1935,6 @@ added: v5.10.0
19771935
Interprets `buf` as an array of unsigned 16-bit integers and swaps the byte-order
19781936
*in-place*. Throws a `RangeError` if [`buf.length`] is not a multiple of 2.
19791937

1980-
Examples:
1981-
19821938
```js
19831939
const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
19841940

@@ -2006,8 +1962,6 @@ added: v5.10.0
20061962
Interprets `buf` as an array of unsigned 32-bit integers and swaps the byte-order
20071963
*in-place*. Throws a `RangeError` if [`buf.length`] is not a multiple of 4.
20081964

2009-
Examples:
2010-
20111965
```js
20121966
const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
20131967

@@ -2035,8 +1989,6 @@ added: v6.3.0
20351989
Interprets `buf` as an array of 64-bit numbers and swaps the byte-order *in-place*.
20361990
Throws a `RangeError` if [`buf.length`] is not a multiple of 8.
20371991

2038-
Examples:
2039-
20401992
```js
20411993
const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
20421994

@@ -2103,8 +2055,6 @@ Decodes `buf` to a string according to the specified character encoding in
21032055
The maximum length of a string instance (in UTF-16 code units) is available
21042056
as [`buffer.constants.MAX_STRING_LENGTH`][].
21052057

2106-
Examples:
2107-
21082058
```js
21092059
const buf1 = Buffer.allocUnsafe(26);
21102060

@@ -2141,8 +2091,6 @@ added: v1.1.0
21412091
Creates and returns an [iterator] for `buf` values (bytes). This function is
21422092
called automatically when a `Buffer` is used in a `for..of` statement.
21432093

2144-
Examples:
2145-
21462094
```js
21472095
const buf = Buffer.from('buffer');
21482096

@@ -2215,8 +2163,6 @@ endian). `value` *should* be a valid 64-bit double. Behavior is undefined when
22152163
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
22162164
the end of `buf`, but the resulting behavior is undefined.
22172165

2218-
Examples:
2219-
22202166
```js
22212167
const buf = Buffer.allocUnsafe(8);
22222168

@@ -2250,8 +2196,6 @@ endian). `value` *should* be a valid 32-bit float. Behavior is undefined when
22502196
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
22512197
the end of `buf`, but the resulting behavior is undefined.
22522198

2253-
Examples:
2254-
22552199
```js
22562200
const buf = Buffer.allocUnsafe(4);
22572201

@@ -2285,8 +2229,6 @@ the end of `buf`, but the resulting behavior is undefined.
22852229

22862230
`value` is interpreted and written as a two's complement signed integer.
22872231

2288-
Examples:
2289-
22902232
```js
22912233
const buf = Buffer.allocUnsafe(2);
22922234

@@ -2318,8 +2260,6 @@ the end of `buf`, but the resulting behavior is undefined.
23182260

23192261
`value` is interpreted and written as a two's complement signed integer.
23202262

2321-
Examples:
2322-
23232263
```js
23242264
const buf = Buffer.allocUnsafe(4);
23252265

@@ -2351,8 +2291,6 @@ the end of `buf`, but the resulting behavior is undefined.
23512291

23522292
`value` is interpreted and written as a two's complement signed integer.
23532293

2354-
Examples:
2355-
23562294
```js
23572295
const buf = Buffer.allocUnsafe(8);
23582296

@@ -2383,8 +2321,6 @@ anything other than a signed integer.
23832321
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
23842322
the end of `buf`, but the resulting behavior is undefined.
23852323

2386-
Examples:
2387-
23882324
```js
23892325
const buf = Buffer.allocUnsafe(6);
23902326

@@ -2416,8 +2352,6 @@ other than an unsigned 8-bit integer.
24162352
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
24172353
the end of `buf`, but the resulting behavior is undefined.
24182354

2419-
Examples:
2420-
24212355
```js
24222356
const buf = Buffer.allocUnsafe(4);
24232357

@@ -2449,8 +2383,6 @@ undefined when `value` is anything other than an unsigned 16-bit integer.
24492383
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
24502384
the end of `buf`, but the resulting behavior is undefined.
24512385

2452-
Examples:
2453-
24542386
```js
24552387
const buf = Buffer.allocUnsafe(4);
24562388

@@ -2486,8 +2418,6 @@ undefined when `value` is anything other than an unsigned 32-bit integer.
24862418
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
24872419
the end of `buf`, but the resulting behavior is undefined.
24882420

2489-
Examples:
2490-
24912421
```js
24922422
const buf = Buffer.allocUnsafe(4);
24932423

@@ -2522,8 +2452,6 @@ anything other than an unsigned integer.
25222452
Setting `noAssert` to `true` allows the encoded form of `value` to extend beyond
25232453
the end of `buf`, but the resulting behavior is undefined.
25242454

2525-
Examples:
2526-
25272455
```js
25282456
const buf = Buffer.allocUnsafe(6);
25292457

0 commit comments

Comments
 (0)