Browse Source

lib: use consistent indentation for ternaries

In anticipation of stricter linting for indentation issues, modify
ternary operators in lib that do not conform with the expected ESLint
settings.

Backport-PR-URL: https://github.com/nodejs/node/pull/14835
PR-URL: https://github.com/nodejs/node/pull/14078
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v6.x
Rich Trott 8 years ago
committed by Myles Borins
parent
commit
f20ed49b5e
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 3
      lib/fs.js
  2. 6
      lib/url.js

3
lib/fs.js

@ -1418,8 +1418,7 @@ function FSWatcher() {
self._handle.close(); self._handle.close();
const error = !filename ? const error = !filename ?
errnoException(status, 'Error watching file for changes:') : errnoException(status, 'Error watching file for changes:') :
errnoException(status, errnoException(status, `Error watching file ${filename} for changes:`);
`Error watching file ${filename} for changes:`);
error.filename = filename; error.filename = filename;
self.emit('error', error); self.emit('error', error);
} else { } else {

6
lib/url.js

@ -567,9 +567,11 @@ Url.prototype.format = function() {
if (this.host) { if (this.host) {
host = auth + this.host; host = auth + this.host;
} else if (this.hostname) { } else if (this.hostname) {
host = auth + (this.hostname.indexOf(':') === -1 ? host = auth + (
this.hostname.indexOf(':') === -1 ?
this.hostname : this.hostname :
'[' + this.hostname + ']'); '[' + this.hostname + ']'
);
if (this.port) { if (this.port) {
host += ':' + this.port; host += ':' + this.port;
} }

Loading…
Cancel
Save