Skip to content

Commit 6361565

Browse files
Trottaddaleax
authored andcommitted
lib: update indentation of ternaries
In preparation for stricter indentation linting and to increase code clarity, update indentation for ternaries in lib. PR-URL: #14247 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 7a116d4 commit 6361565

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

lib/events.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ function _addListener(target, type, listener, prepend) {
262262
} else {
263263
if (typeof existing === 'function') {
264264
// Adding the second element, need to change to array.
265-
existing = events[type] = prepend ? [listener, existing] :
266-
[existing, listener];
265+
existing = events[type] =
266+
prepend ? [listener, existing] : [existing, listener];
267267
} else {
268268
// If we've already got an array, just append.
269269
if (prepend) {

lib/internal/freelist.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ class FreeList {
99
}
1010

1111
alloc() {
12-
return this.list.length ? this.list.pop() :
13-
this.ctor.apply(this, arguments);
12+
return this.list.length ?
13+
this.list.pop() :
14+
this.ctor.apply(this, arguments);
1415
}
1516

1617
free(obj) {

lib/net.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function createHandle(fd) {
6464

6565
function getNewAsyncId(handle) {
6666
return (!handle || typeof handle.getAsyncId !== 'function') ?
67-
newUid() : handle.getAsyncId();
67+
newUid() : handle.getAsyncId();
6868
}
6969

7070

lib/url.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -825,8 +825,8 @@ Url.prototype.resolveObject = function resolveObject(relative) {
825825
//occasionally the auth can get stuck only in host
826826
//this especially happens in cases like
827827
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
828-
const authInHost = result.host && result.host.indexOf('@') > 0 ?
829-
result.host.split('@') : false;
828+
const authInHost =
829+
result.host && result.host.indexOf('@') > 0 && result.host.split('@');
830830
if (authInHost) {
831831
result.auth = authInHost.shift();
832832
result.host = result.hostname = authInHost.shift();
@@ -902,13 +902,13 @@ Url.prototype.resolveObject = function resolveObject(relative) {
902902

903903
// put the host back
904904
if (noLeadingSlashes) {
905-
result.hostname = result.host = isAbsolute ? '' :
906-
srcPath.length ? srcPath.shift() : '';
905+
result.hostname =
906+
result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : '';
907907
//occasionally the auth can get stuck only in host
908908
//this especially happens in cases like
909909
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
910910
const authInHost = result.host && result.host.indexOf('@') > 0 ?
911-
result.host.split('@') : false;
911+
result.host.split('@') : false;
912912
if (authInHost) {
913913
result.auth = authInHost.shift();
914914
result.host = result.hostname = authInHost.shift();

0 commit comments

Comments
 (0)