Browse Source

lib: remove excess indentation

In anticipation of stricter linting for indentation, remove instances of
extra indentation that will be flagged by the new rules.

Backport-PR-URL: https://github.com/nodejs/node/pull/14835
PR-URL: https://github.com/nodejs/node/pull/14090
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
v6.x
Rich Trott 8 years ago
committed by Myles Borins
parent
commit
4dabeeecdd
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 2
      lib/_tls_legacy.js
  2. 2
      lib/_tls_wrap.js
  3. 2
      lib/buffer.js
  4. 29
      lib/fs.js
  5. 6
      lib/internal/child_process.js
  6. 8
      lib/readline.js
  7. 2
      lib/tls.js
  8. 7
      lib/url.js
  9. 2
      lib/util.js

2
lib/_tls_legacy.js

@ -361,7 +361,7 @@ Object.defineProperty(CryptoStream.prototype, 'bytesWritten', {
CryptoStream.prototype.getPeerCertificate = function(detailed) {
if (this.pair.ssl) {
return common.translatePeerCertificate(
this.pair.ssl.getPeerCertificate(detailed));
this.pair.ssl.getPeerCertificate(detailed));
}
return null;

2
lib/_tls_wrap.js

@ -641,7 +641,7 @@ TLSSocket.prototype.setSession = function(session) {
TLSSocket.prototype.getPeerCertificate = function(detailed) {
if (this._handle) {
return common.translatePeerCertificate(
this._handle.getPeerCertificate(detailed));
this._handle.getPeerCertificate(detailed));
}
return null;

2
lib/buffer.js

@ -626,7 +626,7 @@ function slowIndexOf(buffer, val, byteOffset, encoding, dir) {
case 'ascii':
case 'hex':
return binding.indexOfBuffer(
buffer, Buffer.from(val, encoding), byteOffset, encoding, dir);
buffer, Buffer.from(val, encoding), byteOffset, encoding, dir);
default:
if (loweredCase) {

29
lib/fs.js

@ -148,20 +148,21 @@ function isFd(path) {
// Static method to set the stats properties on a Stats object.
function Stats(
dev,
mode,
nlink,
uid,
gid,
rdev,
blksize,
ino,
size,
blocks,
atim_msec,
mtim_msec,
ctim_msec,
birthtim_msec) {
dev,
mode,
nlink,
uid,
gid,
rdev,
blksize,
ino,
size,
blocks,
atim_msec,
mtim_msec,
ctim_msec,
birthtim_msec
) {
this.dev = dev;
this.mode = mode;
this.nlink = nlink;

6
lib/internal/child_process.js

@ -355,11 +355,11 @@ ChildProcess.prototype.spawn = function(options) {
}
this.stdin = stdio.length >= 1 && stdio[0].socket !== undefined ?
stdio[0].socket : null;
stdio[0].socket : null;
this.stdout = stdio.length >= 2 && stdio[1].socket !== undefined ?
stdio[1].socket : null;
stdio[1].socket : null;
this.stderr = stdio.length >= 3 && stdio[2].socket !== undefined ?
stdio[2].socket : null;
stdio[2].socket : null;
this.stdio = stdio.map(function(stdio) {
return stdio.socket === undefined ? null : stdio.socket;

8
lib/readline.js

@ -683,12 +683,12 @@ Interface.prototype._moveCursor = function(dx) {
var diffWidth;
if (diffCursor < 0) {
diffWidth = -getStringWidth(
this.line.substring(this.cursor, oldcursor)
);
this.line.substring(this.cursor, oldcursor)
);
} else if (diffCursor > 0) {
diffWidth = getStringWidth(
this.line.substring(this.cursor, oldcursor)
);
this.line.substring(this.cursor, oldcursor)
);
}
exports.moveCursor(this.output, diffWidth, 0);
this.prevRows = newPos.rows;

2
lib/tls.js

@ -197,7 +197,7 @@ exports.checkServerIdentity = function checkServerIdentity(host, cert) {
if (!valid) {
const err = new Error(
`Hostname/IP doesn't match certificate's altnames: "${reason}"`);
`Hostname/IP doesn't match certificate's altnames: "${reason}"`);
err.reason = reason;
err.host = host;
err.cert = cert;

7
lib/url.js

@ -738,8 +738,7 @@ Url.prototype.resolveObject = function(relative) {
var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/');
var isRelAbs = (
relative.host ||
relative.pathname && relative.pathname.charAt(0) === '/'
relative.host || relative.pathname && relative.pathname.charAt(0) === '/'
);
var mustEndAbs = (isRelAbs || isSourceAbs ||
(result.host && relative.pathname));
@ -843,8 +842,8 @@ Url.prototype.resolveObject = function(relative) {
// then it must NOT get a trailing slash.
var last = srcPath.slice(-1)[0];
var hasTrailingSlash = (
(result.host || relative.host || srcPath.length > 1) &&
(last === '.' || last === '..') || last === '');
(result.host || relative.host || srcPath.length > 1) &&
(last === '.' || last === '..') || last === '');
// strip single dots, resolve double dots to parent dir
// if the path tries to go above the root, `up` ends up > 0

2
lib/util.js

@ -691,7 +691,7 @@ function formatTypedArray(ctx, value, recurseTimes, visibleKeys, keys) {
for (const key of keys) {
if (typeof key === 'symbol' || !numbersOnlyRE.test(key)) {
output.push(
formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
}
}
return output;

Loading…
Cancel
Save