Browse Source

doc: fix indentation issues in sample code

In preparation for stricter ESLint indentation checking, fix a few
issues in sample code.

Backport-PR-URL: https://github.com/nodejs/node/pull/14835
PR-URL: https://github.com/nodejs/node/pull/13950
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6.x
Rich Trott 8 years ago
committed by Myles Borins
parent
commit
a3cd733dea
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 6
      doc/api/crypto.md
  2. 6
      doc/guides/writing-tests.md

6
doc/api/crypto.md

@ -684,10 +684,11 @@ const hash = crypto.createHash('sha256');
hash.on('readable', () => {
const data = hash.read();
if (data)
if (data) {
console.log(data.toString('hex'));
// Prints:
// 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50
}
});
hash.write('some data to hash');
@ -767,10 +768,11 @@ const hmac = crypto.createHmac('sha256', 'a secret');
hmac.on('readable', () => {
const data = hmac.read();
if (data)
if (data) {
console.log(data.toString('hex'));
// Prints:
// 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
}
});
hmac.write('some data to hash');

6
doc/guides/writing-tests.md

@ -25,13 +25,13 @@ Let's analyze this basic test from the Node.js test suite:
```javascript
'use strict'; // 1
const common = require('../common'); // 2
// 3
// This test ensures that the http-parser can handle UTF-8 characters // 4
// in the http header. // 5
// 6
const assert = require('assert'); // 7
const http = require('http'); // 8
// 9
const server = http.createServer(common.mustCall((req, res) => { // 10
res.end('ok'); // 11
})); // 12

Loading…
Cancel
Save