Skip to content

Commit

Permalink
[eslint] fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 6, 2023
1 parent 3226afa commit 34b0f1c
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function setKey(obj, keys, value) {
if (
o[key] === Object.prototype
|| o[key] === Number.prototype
|| o[key] === String.prototype
|| o[key] === String.prototype
) {
o[key] = {};
}
Expand All @@ -45,7 +45,7 @@ function setKey(obj, keys, value) {
if (
o === Object.prototype
|| o === Number.prototype
|| o === String.prototype
|| o === String.prototype
) {
o = {};
}
Expand Down Expand Up @@ -134,10 +134,13 @@ module.exports = function (args, opts) {
} else if ((/^--.+/).test(arg)) {
key = arg.match(/^--(.+)/)[1];
next = args[i + 1];
if (next !== undefined && !(/^-/).test(next)
&& !flags.bools[key]
&& !flags.allBools
&& (aliases[key] ? !flags.bools[aliases[key]] : true)) {
if (
next !== undefined
&& !(/^-/).test(next)
&& !flags.bools[key]
&& !flags.allBools
&& (aliases[key] ? !flags.bools[aliases[key]] : true)
) {
setArg(key, next);
i += 1;
} else if ((/^(true|false)$/).test(next)) {
Expand All @@ -158,8 +161,10 @@ module.exports = function (args, opts) {
continue;
}

if ((/[A-Za-z]/).test(letters[j])
&& (/-?\d+(\.\d*)?(e-?\d+)?$/).test(next)) {
if (
(/[A-Za-z]/).test(letters[j])
&& (/-?\d+(\.\d*)?(e-?\d+)?$/).test(next)
) {
setArg(letters[j], next);
broken = true;
break;
Expand All @@ -176,9 +181,12 @@ module.exports = function (args, opts) {

key = arg.slice(-1)[0];
if (!broken && key !== '-') {
if (args[i + 1] && !(/^(-|--)[^-]/).test(args[i + 1])
&& !flags.bools[key]
&& (aliases[key] ? !flags.bools[aliases[key]] : true)) {
if (
args[i + 1]
&& !(/^(-|--)[^-]/).test(args[i + 1])
&& !flags.bools[key]
&& (aliases[key] ? !flags.bools[aliases[key]] : true)
) {
setArg(key, args[i + 1]);
i += 1;
} else if (args[i + 1] && (/true|false/).test(args[i + 1])) {
Expand Down

0 comments on commit 34b0f1c

Please sign in to comment.