Skip to content

Commit 963ea0e

Browse files
TrottMylesBorins
authored andcommitted
lib: update indentation of ternaries
In preparation for stricter indentation linting and to increase code clarity, update indentation for ternaries in lib. Backport-PR-URL: #14835 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 0cacd6c commit 963ea0e

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

lib/events.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ function _addListener(target, type, listener, prepend) {
240240
} else {
241241
if (typeof existing === 'function') {
242242
// Adding the second element, need to change to array.
243-
existing = events[type] = prepend ? [listener, existing] :
244-
[existing, listener];
243+
existing = events[type] =
244+
prepend ? [listener, existing] : [existing, listener];
245245
} else {
246246
// If we've already got an array, just append.
247247
if (prepend) {

lib/internal/freelist.js

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ exports.FreeList = function(name, max, constructor) {
88
this.list = [];
99
};
1010

11-
1211
exports.FreeList.prototype.alloc = function() {
1312
return this.list.length ? this.list.pop() :
1413
this.constructor.apply(this, arguments);

lib/url.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,8 @@ Url.prototype.resolveObject = function(relative) {
805805
//occasionally the auth can get stuck only in host
806806
//this especially happens in cases like
807807
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
808-
const authInHost = result.host && result.host.indexOf('@') > 0 ?
809-
result.host.split('@') : false;
808+
const authInHost =
809+
result.host && result.host.indexOf('@') > 0 && result.host.split('@');
810810
if (authInHost) {
811811
result.auth = authInHost.shift();
812812
result.host = result.hostname = authInHost.shift();
@@ -882,13 +882,13 @@ Url.prototype.resolveObject = function(relative) {
882882

883883
// put the host back
884884
if (noLeadingSlashes) {
885-
result.hostname = result.host = isAbsolute ? '' :
886-
srcPath.length ? srcPath.shift() : '';
885+
result.hostname =
886+
result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : '';
887887
//occasionally the auth can get stuck only in host
888888
//this especially happens in cases like
889889
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
890890
const authInHost = result.host && result.host.indexOf('@') > 0 ?
891-
result.host.split('@') : false;
891+
result.host.split('@') : false;
892892
if (authInHost) {
893893
result.auth = authInHost.shift();
894894
result.host = result.hostname = authInHost.shift();

0 commit comments

Comments
 (0)