Skip to content

Commit a0866b6

Browse files
Trottaddaleax
authored andcommitted
lib: remove excess indentation
In anticipation of stricter linting for indentation, remove instances of extra indentation that will be flagged by the new rules. PR-URL: #14090 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent e17fb82 commit a0866b6

16 files changed

+51
-49
lines changed

lib/_tls_legacy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ Object.defineProperty(CryptoStream.prototype, 'bytesWritten', {
384384
CryptoStream.prototype.getPeerCertificate = function(detailed) {
385385
if (this.pair.ssl) {
386386
return common.translatePeerCertificate(
387-
this.pair.ssl.getPeerCertificate(detailed));
387+
this.pair.ssl.getPeerCertificate(detailed));
388388
}
389389

390390
return null;

lib/_tls_wrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ TLSSocket.prototype.setSession = function(session) {
659659
TLSSocket.prototype.getPeerCertificate = function(detailed) {
660660
if (this._handle) {
661661
return common.translatePeerCertificate(
662-
this._handle.getPeerCertificate(detailed));
662+
this._handle.getPeerCertificate(detailed));
663663
}
664664

665665
return null;

lib/async_hooks.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ function fatalError(e) {
7171
Error.captureStackTrace(o, fatalError);
7272
process._rawDebug(o.stack);
7373
}
74-
if (process.execArgv.some(
75-
(e) => /^--abort[_-]on[_-]uncaught[_-]exception$/.test(e))) {
74+
if (process.execArgv.some((e) => /^--abort[_-]on[_-]uncaught[_-]exception$/.test(e))) {
7675
process.abort();
7776
}
7877
process.exit(1);
@@ -434,8 +433,8 @@ function init(asyncId, type, triggerAsyncId, resource) {
434433
for (var i = 0; i < active_hooks_array.length; i++) {
435434
if (typeof active_hooks_array[i][init_symbol] === 'function') {
436435
active_hooks_array[i][init_symbol](
437-
asyncId, type, triggerAsyncId,
438-
resource
436+
asyncId, type, triggerAsyncId,
437+
resource
439438
);
440439
}
441440
}

lib/buffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ function slowIndexOf(buffer, val, byteOffset, encoding, dir) {
762762
case 'ascii':
763763
case 'hex':
764764
return binding.indexOfBuffer(
765-
buffer, Buffer.from(val, encoding), byteOffset, encoding, dir);
765+
buffer, Buffer.from(val, encoding), byteOffset, encoding, dir);
766766

767767
default:
768768
if (loweredCase) {

lib/child_process.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ exports.fork = function(modulePath /*, args, options*/) {
8989
// Use a separate fd=3 for the IPC channel. Inherit stdin, stdout,
9090
// and stderr from the parent if silent isn't set.
9191
options.stdio = options.silent ? stdioStringToArray('pipe') :
92-
stdioStringToArray('inherit');
92+
stdioStringToArray('inherit');
9393
} else if (options.stdio.indexOf('ipc') === -1) {
9494
throw new TypeError('Forked processes must have an IPC channel');
9595
}
@@ -543,9 +543,9 @@ function spawnSync(/*file, args, options*/) {
543543
pipe.input = Buffer.from(input, options.encoding);
544544
} else {
545545
throw new TypeError(util.format(
546-
'stdio[%d] should be Buffer, Uint8Array or string not %s',
547-
i,
548-
typeof input));
546+
'stdio[%d] should be Buffer, Uint8Array or string not %s',
547+
i,
548+
typeof input));
549549
}
550550
}
551551
}

lib/crypto.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ function pbkdf2(password, salt, iterations, keylen, digest, callback) {
633633

634634
if (digest === undefined) {
635635
throw new TypeError(
636-
'The "digest" argument is required and must not be undefined');
636+
'The "digest" argument is required and must not be undefined');
637637
}
638638

639639
password = toBuf(password);

lib/fs.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -172,20 +172,21 @@ function isFd(path) {
172172

173173
// Constructor for file stats.
174174
function Stats(
175-
dev,
176-
mode,
177-
nlink,
178-
uid,
179-
gid,
180-
rdev,
181-
blksize,
182-
ino,
183-
size,
184-
blocks,
185-
atim_msec,
186-
mtim_msec,
187-
ctim_msec,
188-
birthtim_msec) {
175+
dev,
176+
mode,
177+
nlink,
178+
uid,
179+
gid,
180+
rdev,
181+
blksize,
182+
ino,
183+
size,
184+
blocks,
185+
atim_msec,
186+
mtim_msec,
187+
ctim_msec,
188+
birthtim_msec
189+
) {
189190
this.dev = dev;
190191
this.mode = mode;
191192
this.nlink = nlink;
@@ -1285,7 +1286,7 @@ fs.writeFile = function(path, data, options, callback) {
12851286

12861287
function writeFd(fd, isUserFd) {
12871288
var buffer = isUint8Array(data) ?
1288-
data : Buffer.from('' + data, options.encoding || 'utf8');
1289+
data : Buffer.from('' + data, options.encoding || 'utf8');
12891290
var position = /a/.test(flag) ? null : 0;
12901291

12911292
writeAll(fd, isUserFd, buffer, 0, buffer.length, position, callback);

lib/inspector.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ class Session extends EventEmitter {
4343
post(method, params, callback) {
4444
if (typeof method !== 'string') {
4545
throw new TypeError(
46-
`"method" must be a string, got ${typeof method} instead`);
46+
`"method" must be a string, got ${typeof method} instead`);
4747
}
4848
if (!callback && util.isFunction(params)) {
4949
callback = params;
5050
params = null;
5151
}
5252
if (params && typeof params !== 'object') {
5353
throw new TypeError(
54-
`"params" must be an object, got ${typeof params} instead`);
54+
`"params" must be an object, got ${typeof params} instead`);
5555
}
5656
if (callback && typeof callback !== 'function') {
5757
throw new TypeError(
58-
`"callback" must be a function, got ${typeof callback} instead`);
58+
`"callback" must be a function, got ${typeof callback} instead`);
5959
}
6060

6161
if (!this[connectionSymbol]) {

lib/internal/bootstrap_node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@
348348
if (async_hook_fields[kAfter] > 0) {
349349
do {
350350
NativeModule.require('async_hooks').emitAfter(
351-
async_uid_fields[kCurrentAsyncId]);
351+
async_uid_fields[kCurrentAsyncId]);
352352
// popAsyncIds() returns true if there are more ids on the stack.
353353
} while (popAsyncIds(async_uid_fields[kCurrentAsyncId]));
354354
// Or completely empty the id stack.

lib/internal/child_process.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ ChildProcess.prototype.spawn = function(options) {
340340
// when i === 0 - we're dealing with stdin
341341
// (which is the only one writable pipe)
342342
stream.socket = createSocket(this.pid !== 0 ?
343-
stream.handle : null, i > 0);
343+
stream.handle : null, i > 0);
344344

345345
if (i > 0 && this.pid !== 0) {
346346
this._closesNeeded++;
@@ -352,11 +352,11 @@ ChildProcess.prototype.spawn = function(options) {
352352
}
353353

354354
this.stdin = stdio.length >= 1 && stdio[0].socket !== undefined ?
355-
stdio[0].socket : null;
355+
stdio[0].socket : null;
356356
this.stdout = stdio.length >= 2 && stdio[1].socket !== undefined ?
357-
stdio[1].socket : null;
357+
stdio[1].socket : null;
358358
this.stderr = stdio.length >= 3 && stdio[2].socket !== undefined ?
359-
stdio[2].socket : null;
359+
stdio[2].socket : null;
360360

361361
this.stdio = [];
362362

0 commit comments

Comments
 (0)