summaryrefslogtreecommitdiff
path: root/lib/url.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-07-14 21:00:36 -0700
committerRich Trott <rtrott@gmail.com>2017-07-17 22:09:46 -0700
commitd14c13238b554be335bbf66a315f855e49fdd52e (patch)
tree626d0743b367b8cc287a207051c31d80400c5efd /lib/url.js
parent9ab63d61f8f8d65b0e0643c83dd7936c4cf0a309 (diff)
downloadandroid-node-v8-d14c13238b554be335bbf66a315f855e49fdd52e.tar.gz
android-node-v8-d14c13238b554be335bbf66a315f855e49fdd52e.tar.bz2
android-node-v8-d14c13238b554be335bbf66a315f855e49fdd52e.zip
lib: update indentation of ternaries
In preparation for stricter indentation linting and to increase code clarity, update indentation for ternaries in lib. PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'lib/url.js')
-rw-r--r--lib/url.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/url.js b/lib/url.js
index 3af9e8f7bf..f48ad08512 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -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();
@@ -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();