Skip to content

Commit 867deda

Browse files
committed
squash: make indentation consistent for all docs
1 parent a3bbc3d commit 867deda

13 files changed

+251
-229
lines changed

doc/api/addons.md

+28-14
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ Once built, the binary Addon can be used from within Node.js by pointing
140140
// hello.js
141141
const addon = require('./build/Release/addon');
142142
143-
console.log(addon.hello()); // 'world'
143+
console.log(addon.hello());
144+
// Prints: 'world'
144145
```
145146
146147
Please see the examples below for further information or
@@ -372,7 +373,8 @@ To test it, run the following JavaScript:
372373
const addon = require('./build/Release/addon');
373374
374375
addon((msg) => {
375-
console.log(msg); // 'hello world'
376+
console.log(msg);
377+
// Prints: 'hello world'
376378
});
377379
```
378380

@@ -423,7 +425,8 @@ const addon = require('./build/Release/addon');
423425
424426
var obj1 = addon('hello');
425427
var obj2 = addon('world');
426-
console.log(obj1.msg, obj2.msg); // 'hello world'
428+
console.log(obj1.msg, obj2.msg);
429+
// Prints: 'hello world'
427430
```
428431

429432

@@ -480,7 +483,8 @@ To test:
480483
const addon = require('./build/Release/addon');
481484
482485
var fn = addon();
483-
console.log(fn()); // 'hello world'
486+
console.log(fn());
487+
// Prints: 'hello world'
484488
```
485489

486490

@@ -642,9 +646,12 @@ Test it with:
642646
const addon = require('./build/Release/addon');
643647

644648
var obj = new addon.MyObject(10);
645-
console.log(obj.plusOne()); // 11
646-
console.log(obj.plusOne()); // 12
647-
console.log(obj.plusOne()); // 13
649+
console.log(obj.plusOne());
650+
// Prints: 11
651+
console.log(obj.plusOne());
652+
// Prints: 12
653+
console.log(obj.plusOne());
654+
// Prints: 13
648655
```
649656

650657
### Factory of wrapped objects
@@ -834,14 +841,20 @@ Test it with:
834841
const createObject = require('./build/Release/addon');
835842

836843
var obj = createObject(10);
837-
console.log(obj.plusOne()); // 11
838-
console.log(obj.plusOne()); // 12
839-
console.log(obj.plusOne()); // 13
844+
console.log(obj.plusOne());
845+
// Prints: 11
846+
console.log(obj.plusOne());
847+
// Prints: 12
848+
console.log(obj.plusOne());
849+
// Prints: 13
840850

841851
var obj2 = createObject(20);
842-
console.log(obj2.plusOne()); // 21
843-
console.log(obj2.plusOne()); // 22
844-
console.log(obj2.plusOne()); // 23
852+
console.log(obj2.plusOne());
853+
// Prints: 21
854+
console.log(obj2.plusOne());
855+
// Prints: 22
856+
console.log(obj2.plusOne());
857+
// Prints: 23
845858
```
846859

847860

@@ -1013,7 +1026,8 @@ var obj1 = addon.createObject(10);
10131026
var obj2 = addon.createObject(20);
10141027
var result = addon.add(obj1, obj2);
10151028
1016-
console.log(result); // 30
1029+
console.log(result);
1030+
// Prints: 30
10171031
```
10181032

10191033
### AtExit hooks

doc/api/assert.md

+52-44
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ An alias of [`assert.ok()`][] .
2222
```js
2323
const assert = require('assert');
2424

25-
assert(true); // OK
26-
assert(1); // OK
25+
assert(true);
26+
// OK
27+
assert(1);
28+
// OK
2729
assert(false);
28-
// throws "AssertionError: false == true"
30+
// throws "AssertionError: false == true"
2931
assert(0);
30-
// throws "AssertionError: 0 == true"
32+
// throws "AssertionError: 0 == true"
3133
assert(false, 'it\'s false');
32-
// throws "AssertionError: it's false"
34+
// throws "AssertionError: it's false"
3335
```
3436

3537
## assert.deepEqual(actual, expected[, message])
@@ -75,18 +77,18 @@ const obj3 = {
7577
const obj4 = Object.create(obj1);
7678

7779
assert.deepEqual(obj1, obj1);
78-
// OK, object is equal to itself
80+
// OK, object is equal to itself
7981

8082
assert.deepEqual(obj1, obj2);
81-
// AssertionError: { a: { b: 1 } } deepEqual { a: { b: 2 } }
82-
// values of b are different
83+
// AssertionError: { a: { b: 1 } } deepEqual { a: { b: 2 } }
84+
// values of b are different
8385

8486
assert.deepEqual(obj1, obj3);
85-
// OK, objects are equal
87+
// OK, objects are equal
8688

8789
assert.deepEqual(obj1, obj4);
88-
// AssertionError: { a: { b: 1 } } deepEqual {}
89-
// Prototypes are ignored
90+
// AssertionError: { a: { b: 1 } } deepEqual {}
91+
// Prototypes are ignored
9092
```
9193

9294
If the values are not equal, an `AssertionError` is thrown with a `message`
@@ -106,11 +108,11 @@ Second, object comparisons include a strict equality check of their prototypes.
106108
const assert = require('assert');
107109

108110
assert.deepEqual({a:1}, {a:'1'});
109-
// OK, because 1 == '1'
111+
// OK, because 1 == '1'
110112

111113
assert.deepStrictEqual({a:1}, {a:'1'});
112-
// AssertionError: { a: 1 } deepStrictEqual { a: '1' }
113-
// because 1 !== '1' using strict equality
114+
// AssertionError: { a: 1 } deepStrictEqual { a: '1' }
115+
// because 1 !== '1' using strict equality
114116
```
115117

116118
If the values are not equal, an `AssertionError` is thrown with a `message`
@@ -184,14 +186,14 @@ using the equal comparison operator ( `==` ).
184186
const assert = require('assert');
185187

186188
assert.equal(1, 1);
187-
// OK, 1 == 1
189+
// OK, 1 == 1
188190
assert.equal(1, '1');
189-
// OK, 1 == '1'
191+
// OK, 1 == '1'
190192

191193
assert.equal(1, 2);
192-
// AssertionError: 1 == 2
194+
// AssertionError: 1 == 2
193195
assert.equal({a: {b: 1}}, {a: {b: 1}});
194-
//AssertionError: { a: { b: 1 } } == { a: { b: 1 } }
196+
//AssertionError: { a: { b: 1 } } == { a: { b: 1 } }
195197
```
196198

197199
If the values are not equal, an `AssertionError` is thrown with a `message`
@@ -211,10 +213,10 @@ Otherwise, the error message is the value of `message`.
211213
const assert = require('assert');
212214

213215
assert.fail(1, 2, undefined, '>');
214-
// AssertionError: 1 > 2
216+
// AssertionError: 1 > 2
215217

216218
assert.fail(1, 2, 'whoops', '>');
217-
// AssertionError: whoops
219+
// AssertionError: whoops
218220
```
219221

220222
## assert.ifError(value)
@@ -228,10 +230,14 @@ argument in callbacks.
228230
```js
229231
const assert = require('assert');
230232

231-
assert.ifError(0); // OK
232-
assert.ifError(1); // Throws 1
233-
assert.ifError('error'); // Throws 'error'
234-
assert.ifError(new Error()); // Throws Error
233+
assert.ifError(0);
234+
// OK
235+
assert.ifError(1);
236+
// Throws 1
237+
assert.ifError('error');
238+
// Throws 'error'
239+
assert.ifError(new Error());
240+
// Throws Error
235241
```
236242

237243
## assert.notDeepEqual(actual, expected[, message])
@@ -262,16 +268,16 @@ const obj3 = {
262268
const obj4 = Object.create(obj1);
263269

264270
assert.notDeepEqual(obj1, obj1);
265-
// AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
271+
// AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
266272

267273
assert.notDeepEqual(obj1, obj2);
268-
// OK, obj1 and obj2 are not deeply equal
274+
// OK, obj1 and obj2 are not deeply equal
269275

270276
assert.notDeepEqual(obj1, obj3);
271-
// AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
277+
// AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
272278

273279
assert.notDeepEqual(obj1, obj4);
274-
// OK, obj1 and obj4 are not deeply equal
280+
// OK, obj1 and obj2 are not deeply equal
275281
```
276282

277283
If the values are deeply equal, an `AssertionError` is thrown with a `message`
@@ -289,10 +295,10 @@ Tests for deep strict inequality. Opposite of [`assert.deepStrictEqual()`][].
289295
const assert = require('assert');
290296

291297
assert.notDeepEqual({a:1}, {a:'1'});
292-
// AssertionError: { a: 1 } notDeepEqual { a: '1' }
298+
// AssertionError: { a: 1 } notDeepEqual { a: '1' }
293299

294300
assert.notDeepStrictEqual({a:1}, {a:'1'});
295-
// OK
301+
// OK
296302
```
297303

298304
If the values are deeply and strictly equal, an `AssertionError` is thrown
@@ -311,13 +317,13 @@ Tests shallow, coercive inequality with the not equal comparison operator
311317
const assert = require('assert');
312318

313319
assert.notEqual(1, 2);
314-
// OK
320+
// OK
315321

316322
assert.notEqual(1, 1);
317-
// AssertionError: 1 != 1
323+
// AssertionError: 1 != 1
318324

319325
assert.notEqual(1, '1');
320-
// AssertionError: 1 != '1'
326+
// AssertionError: 1 != '1'
321327
```
322328

323329
If the values are equal, an `AssertionError` is thrown with a `message`
@@ -336,13 +342,13 @@ Tests strict inequality as determined by the strict not equal operator
336342
const assert = require('assert');
337343

338344
assert.notStrictEqual(1, 2);
339-
// OK
345+
// OK
340346

341347
assert.notStrictEqual(1, 1);
342-
// AssertionError: 1 != 1
348+
// AssertionError: 1 != 1
343349

344350
assert.notStrictEqual(1, '1');
345-
// OK
351+
// OK
346352
```
347353

348354
If the values are strictly equal, an `AssertionError` is thrown with a
@@ -364,14 +370,16 @@ parameter is `undefined`, a default error message is assigned.
364370
```js
365371
const assert = require('assert');
366372

367-
assert.ok(true); // OK
368-
assert.ok(1); // OK
373+
assert.ok(true);
374+
// OK
375+
assert.ok(1);
376+
// OK
369377
assert.ok(false);
370-
// throws "AssertionError: false == true"
378+
// throws "AssertionError: false == true"
371379
assert.ok(0);
372-
// throws "AssertionError: 0 == true"
380+
// throws "AssertionError: 0 == true"
373381
assert.ok(false, 'it\'s false');
374-
// throws "AssertionError: it's false"
382+
// throws "AssertionError: it's false"
375383
```
376384

377385
## assert.strictEqual(actual, expected[, message])
@@ -385,13 +393,13 @@ Tests strict equality as determined by the strict equality operator ( `===` ).
385393
const assert = require('assert');
386394

387395
assert.strictEqual(1, 2);
388-
// AssertionError: 1 === 2
396+
// AssertionError: 1 === 2
389397

390398
assert.strictEqual(1, 1);
391-
// OK
399+
// OK
392400

393401
assert.strictEqual(1, '1');
394-
// AssertionError: 1 === '1'
402+
// AssertionError: 1 === '1'
395403
```
396404

397405
If the values are not strictly equal, an `AssertionError` is thrown with a

doc/api/buffer.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ Example:
406406
```js
407407
const buf = new Buffer(5);
408408

409-
// Prints (contents may vary): <Buffer 78 e0 82 02 01>
409+
// Prints: (contents may vary): <Buffer 78 e0 82 02 01>
410410
console.log(buf);
411411

412412
buf.fill(0);
@@ -525,7 +525,7 @@ Example:
525525
```js
526526
const buf = Buffer.allocUnsafe(5);
527527

528-
// Prints (contents may vary): <Buffer 78 e0 82 02 01>
528+
// Prints: (contents may vary): <Buffer 78 e0 82 02 01>
529529
console.log(buf);
530530

531531
buf.fill(0);
@@ -1755,12 +1755,12 @@ Examples:
17551755
```js
17561756
const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
17571757

1758-
// Prints <Buffer 01 02 03 04 05 06 07 08>
1758+
// Prints: <Buffer 01 02 03 04 05 06 07 08>
17591759
console.log(buf1);
17601760

17611761
buf1.swap32();
17621762

1763-
// Prints <Buffer 04 03 02 01 08 07 06 05>
1763+
// Prints: <Buffer 04 03 02 01 08 07 06 05>
17641764
console.log(buf1);
17651765

17661766

@@ -1785,12 +1785,12 @@ Examples:
17851785
```js
17861786
const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
17871787

1788-
// Prints <Buffer 01 02 03 04 05 06 07 08>
1788+
// Prints: <Buffer 01 02 03 04 05 06 07 08>
17891789
console.log(buf1);
17901790

17911791
buf1.swap64();
17921792

1793-
// Prints <Buffer 08 07 06 05 04 03 02 01>
1793+
// Prints: <Buffer 08 07 06 05 04 03 02 01>
17941794
console.log(buf1);
17951795

17961796

@@ -2327,7 +2327,7 @@ sequence cannot be adequately represented in the target encoding. For instance:
23272327
```js
23282328
const newBuf = buffer.transcode(Buffer.from(''), 'utf8', 'ascii');
23292329
console.log(newBuf.toString('ascii'));
2330-
// prints '?'
2330+
// Prints: '?'
23312331
```
23322332

23332333
Because the Euro (``) sign is not representable in US-ASCII, it is replaced
@@ -2397,7 +2397,7 @@ const SlowBuffer = require('buffer').SlowBuffer;
23972397

23982398
const buf = new SlowBuffer(5);
23992399

2400-
// Prints (contents may vary): <Buffer 78 e0 82 02 01>
2400+
// Prints: (contents may vary): <Buffer 78 e0 82 02 01>
24012401
console.log(buf);
24022402

24032403
buf.fill(0);

0 commit comments

Comments
 (0)