Skip to content

Commit

Permalink
fix(template): handle invalid config
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Nov 21, 2019
1 parent 61f4f0d commit c13ebf6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,18 @@ path = path.map(str => {
});

if (typeof template === 'string') {
if (template.length > 0) template = [template];
if (template.length >= 1) template = [template];
}

if (Array.isArray(template)) {
if (template.length > 2) template = template.slice(0, 2);
if (template.length < type.length) template.push(join(__dirname, `${type[1]}.xml`));
if (template.length >= 1) {
if (template.length > 2) template = template.slice(0, 2);
if (template.length < type.length) template.push(join(__dirname, `${type[1]}.xml`));
} else {
template = null;
}
} else {
template = null;
}

config.type = type;
Expand Down

0 comments on commit c13ebf6

Please sign in to comment.