Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: update indentation of ternaries #14247

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ function _addListener(target, type, listener, prepend) {
} else {
if (typeof existing === 'function') {
// Adding the second element, need to change to array.
existing = events[type] = prepend ? [listener, existing] :
[existing, listener];
existing = events[type] =
prepend ? [listener, existing] : [existing, listener];
} else {
// If we've already got an array, just append.
if (prepend) {
Expand Down
5 changes: 3 additions & 2 deletions lib/internal/freelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ class FreeList {
}

alloc() {
return this.list.length ? this.list.pop() :
this.ctor.apply(this, arguments);
return this.list.length ?
this.list.pop() :
this.ctor.apply(this, arguments);
}

free(obj) {
Expand Down
2 changes: 1 addition & 1 deletion lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function createHandle(fd) {

function getNewAsyncId(handle) {
return (!handle || typeof handle.getAsyncId !== 'function') ?
newUid() : handle.getAsyncId();
newUid() : handle.getAsyncId();
}


Expand Down
10 changes: 5 additions & 5 deletions lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,8 @@ Url.prototype.resolveObject = function resolveObject(relative) {
//occasionally the auth can get stuck only in host
//this especially happens in cases like
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
const authInHost = result.host && result.host.indexOf('@') > 0 ?
result.host.split('@') : false;
const authInHost =
result.host && result.host.indexOf('@') > 0 && result.host.split('@');
if (authInHost) {
result.auth = authInHost.shift();
result.host = result.hostname = authInHost.shift();
Expand Down Expand Up @@ -904,13 +904,13 @@ Url.prototype.resolveObject = function resolveObject(relative) {

// put the host back
if (noLeadingSlashes) {
result.hostname = result.host = isAbsolute ? '' :
srcPath.length ? srcPath.shift() : '';
result.hostname =
result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : '';
//occasionally the auth can get stuck only in host
//this especially happens in cases like
//url.resolveObject('mailto:local1@domain1', 'local2@domain2')
const authInHost = result.host && result.host.indexOf('@') > 0 ?
result.host.split('@') : false;
result.host.split('@') : false;
if (authInHost) {
result.auth = authInHost.shift();
result.host = result.hostname = authInHost.shift();
Expand Down