fix faulty logic
This commit is contained in:
parent
4c21cbf643
commit
3de793217b
1 changed files with 5 additions and 5 deletions
10
parse.js
10
parse.js
|
@ -23,9 +23,12 @@ export default function parse(data) {
|
|||
let match = functions[command];
|
||||
if (match != undefined) {
|
||||
if (
|
||||
!(match.options["requires_arg1"] && arg1 != undefined) &&
|
||||
!(match.options["requires_arg2"] && arg2 != undefined)
|
||||
(match.options["requires_arg1"] && arg1 == undefined) ||
|
||||
(match.options["requires_arg2"] && arg2 == undefined)
|
||||
) {
|
||||
errors.push(`error parsing line ${lineNumber}, invalid number of args`);
|
||||
}
|
||||
else {
|
||||
parsed.push(
|
||||
{
|
||||
command: command,
|
||||
|
@ -34,9 +37,6 @@ export default function parse(data) {
|
|||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
errors.push(`error parsing line ${lineNumber}, invalid number of args`);
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue