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 <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent e17fb82 commit a0866b6

16 files changed

+51
-49
lines changed

lib/_tls_legacy.js

+1-1
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

+1-1
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

+3-4
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

+1-1
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

+4-4
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

+1-1
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

+16-15
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

+3-3
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

+1-1
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

+4-4
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

lib/internal/readline.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ if (process.binding('config').hasIntl) {
8484

8585
// Code points are derived from:
8686
// http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt
87-
if (code >= 0x1100 && (
87+
if (
88+
code >= 0x1100 && (
8889
code <= 0x115f || // Hangul Jamo
8990
0x2329 === code || // LEFT-POINTING ANGLE BRACKET
9091
0x232a === code || // RIGHT-POINTING ANGLE BRACKET
@@ -112,7 +113,9 @@ if (process.binding('config').hasIntl) {
112113
// Enclosed Ideographic Supplement
113114
0x1f200 <= code && code <= 0x1f251 ||
114115
// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
115-
0x20000 <= code && code <= 0x3fffd)) {
116+
0x20000 <= code && code <= 0x3fffd
117+
)
118+
) {
116119
return true;
117120
}
118121

lib/readline.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -725,12 +725,12 @@ Interface.prototype._moveCursor = function(dx) {
725725
var diffWidth;
726726
if (diffCursor < 0) {
727727
diffWidth = -getStringWidth(
728-
this.line.substring(this.cursor, oldcursor)
729-
);
728+
this.line.substring(this.cursor, oldcursor)
729+
);
730730
} else if (diffCursor > 0) {
731731
diffWidth = getStringWidth(
732-
this.line.substring(this.cursor, oldcursor)
733-
);
732+
this.line.substring(this.cursor, oldcursor)
733+
);
734734
}
735735
moveCursor(this.output, diffWidth, 0);
736736
this.prevRows = newPos.rows;

lib/timers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ function listOnTimeout() {
296296
function tryOnTimeout(timer, list) {
297297
timer._called = true;
298298
const timerAsyncId = (typeof timer[async_id_symbol] === 'number') ?
299-
timer[async_id_symbol] : null;
299+
timer[async_id_symbol] : null;
300300
var threw = true;
301301
if (timerAsyncId !== null)
302302
emitBefore(timerAsyncId, timer[trigger_id_symbol]);

lib/tls.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ exports.checkServerIdentity = function checkServerIdentity(host, cert) {
220220

221221
if (!valid) {
222222
const err = new Error(
223-
`Hostname/IP doesn't match certificate's altnames: "${reason}"`);
223+
`Hostname/IP doesn't match certificate's altnames: "${reason}"`);
224224
err.reason = reason;
225225
err.host = host;
226226
err.cert = cert;

lib/url.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,7 @@ Url.prototype.resolveObject = function resolveObject(relative) {
758758

759759
var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/');
760760
var isRelAbs = (
761-
relative.host ||
762-
relative.pathname && relative.pathname.charAt(0) === '/'
761+
relative.host || relative.pathname && relative.pathname.charAt(0) === '/'
763762
);
764763
var mustEndAbs = (isRelAbs || isSourceAbs ||
765764
(result.host && relative.pathname));
@@ -863,8 +862,8 @@ Url.prototype.resolveObject = function resolveObject(relative) {
863862
// then it must NOT get a trailing slash.
864863
var last = srcPath.slice(-1)[0];
865864
var hasTrailingSlash = (
866-
(result.host || relative.host || srcPath.length > 1) &&
867-
(last === '.' || last === '..') || last === '');
865+
(result.host || relative.host || srcPath.length > 1) &&
866+
(last === '.' || last === '..') || last === '');
868867

869868
// strip single dots, resolve double dots to parent dir
870869
// if the path tries to go above the root, `up` ends up > 0

lib/util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ function formatValue(ctx, value, recurseTimes) {
398398
if (typeof value === 'function') {
399399
const ctorName = constructor ? constructor.name : 'Function';
400400
return ctx.stylize(
401-
`[${ctorName}${value.name ? `: ${value.name}` : ''}]`, 'special');
401+
`[${ctorName}${value.name ? `: ${value.name}` : ''}]`, 'special');
402402
}
403403
if (isRegExp(value)) {
404404
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
@@ -693,7 +693,7 @@ function formatTypedArray(ctx, value, recurseTimes, visibleKeys, keys) {
693693
for (const key of keys) {
694694
if (typeof key === 'symbol' || !numbersOnlyRE.test(key)) {
695695
output.push(
696-
formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
696+
formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
697697
}
698698
}
699699
return output;

0 commit comments

Comments
 (0)