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 <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 0cacd6c commit 963ea0e

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎lib/events.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ function _addListener(target, type, listener, prepend) {
240240
}else{
241241
if(typeofexisting==='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‎

Lines changed: 0 additions & 1 deletion
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
returnthis.list.length ? this.list.pop() :
1413
this.constructor.apply(this,arguments);

‎lib/url.js‎

Lines changed: 5 additions & 5 deletions
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-
constauthInHost=result.host&&result.host.indexOf('@')>0 ?
809-
result.host.split('@') : false;
808+
constauthInHost=
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
constauthInHost=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)