Skip to content

Commit 2c385d9

Browse files
committed
lib: remove excess indentation
In anticipation of stricter linting for indentation, remove instances of extra indentation that will be flagged by the new rules.
1 parent 85dacd6 commit 2c385d9

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
@@ -763,7 +763,7 @@ function slowIndexOf(buffer, val, byteOffset, encoding, dir) {
763763
case 'ascii':
764764
case 'hex':
765765
return binding.indexOfBuffer(
766-
buffer, Buffer.from(val, encoding), byteOffset, encoding, dir);
766+
buffer, Buffer.from(val, encoding), byteOffset, encoding, dir);
767767

768768
default:
769769
if (loweredCase) {

lib/child_process.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ exports.fork = function(modulePath /*, args, options*/) {
8787
// Use a separate fd=3 for the IPC channel. Inherit stdin, stdout,
8888
// and stderr from the parent if silent isn't set.
8989
options.stdio = options.silent ? stdioStringToArray('pipe') :
90-
stdioStringToArray('inherit');
90+
stdioStringToArray('inherit');
9191
} else if (options.stdio.indexOf('ipc') === -1) {
9292
throw new TypeError('Forked processes must have an IPC channel');
9393
}
@@ -539,9 +539,9 @@ function spawnSync(/*file, args, options*/) {
539539
pipe.input = Buffer.from(input, options.encoding);
540540
} else {
541541
throw new TypeError(util.format(
542-
'stdio[%d] should be Buffer, Uint8Array or string not %s',
543-
i,
544-
typeof input));
542+
'stdio[%d] should be Buffer, Uint8Array or string not %s',
543+
i,
544+
typeof input));
545545
}
546546
}
547547
}

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
@@ -347,7 +347,7 @@ ChildProcess.prototype.spawn = function(options) {
347347
// when i === 0 - we're dealing with stdin
348348
// (which is the only one writable pipe)
349349
stream.socket = createSocket(this.pid !== 0 ?
350-
stream.handle : null, i > 0);
350+
stream.handle : null, i > 0);
351351

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

361361
this.stdin = stdio.length >= 1 && stdio[0].socket !== undefined ?
362-
stdio[0].socket : null;
362+
stdio[0].socket : null;
363363
this.stdout = stdio.length >= 2 && stdio[1].socket !== undefined ?
364-
stdio[1].socket : null;
364+
stdio[1].socket : null;
365365
this.stderr = stdio.length >= 3 && stdio[2].socket !== undefined ?
366-
stdio[2].socket : null;
366+
stdio[2].socket : null;
367367

368368
this.stdio = [];
369369

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
@@ -736,12 +736,12 @@ Interface.prototype._moveCursor = function(dx) {
736736
var diffWidth;
737737
if (diffCursor < 0) {
738738
diffWidth = -getStringWidth(
739-
this.line.substring(this.cursor, oldcursor)
740-
);
739+
this.line.substring(this.cursor, oldcursor)
740+
);
741741
} else if (diffCursor > 0) {
742742
diffWidth = getStringWidth(
743-
this.line.substring(this.cursor, oldcursor)
744-
);
743+
this.line.substring(this.cursor, oldcursor)
744+
);
745745
}
746746
moveCursor(this.output, diffWidth, 0);
747747
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
@@ -760,8 +760,7 @@ Url.prototype.resolveObject = function resolveObject(relative) {
760760

761761
var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/');
762762
var isRelAbs = (
763-
relative.host ||
764-
relative.pathname && relative.pathname.charAt(0) === '/'
763+
relative.host || relative.pathname && relative.pathname.charAt(0) === '/'
765764
);
766765
var mustEndAbs = (isRelAbs || isSourceAbs ||
767766
(result.host && relative.pathname));
@@ -865,8 +864,8 @@ Url.prototype.resolveObject = function resolveObject(relative) {
865864
// then it must NOT get a trailing slash.
866865
var last = srcPath.slice(-1)[0];
867866
var hasTrailingSlash = (
868-
(result.host || relative.host || srcPath.length > 1) &&
869-
(last === '.' || last === '..') || last === '');
867+
(result.host || relative.host || srcPath.length > 1) &&
868+
(last === '.' || last === '..') || last === '');
870869

871870
// strip single dots, resolve double dots to parent dir
872871
// 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
@@ -400,7 +400,7 @@ function formatValue(ctx, value, recurseTimes) {
400400
if (typeof value === 'function') {
401401
const ctorName = constructor ? constructor.name : 'Function';
402402
return ctx.stylize(
403-
`[${ctorName}${value.name ? `: ${value.name}` : ''}]`, 'special');
403+
`[${ctorName}${value.name ? `: ${value.name}` : ''}]`, 'special');
404404
}
405405
if (isRegExp(value)) {
406406
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
@@ -695,7 +695,7 @@ function formatTypedArray(ctx, value, recurseTimes, visibleKeys, keys) {
695695
for (const key of keys) {
696696
if (typeof key === 'symbol' || !numbersOnlyRE.test(key)) {
697697
output.push(
698-
formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
698+
formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
699699
}
700700
}
701701
return output;

0 commit comments

Comments
 (0)