Skip to content

Commit

Permalink
Make sure ignore is an array.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann-S authored and XhmikosR committed Oct 29, 2018
1 parent bda641b commit 6da32e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function findUnusedVars(strDir, opts) {
const options = Object.assign(defaultOption, opts);
const dir = path.isAbsolute(strDir) ? strDir : path.resolve(strDir);

if (typeof options.ignore === 'string') {
options.ignore = options.ignore.split(',');
if (Boolean(options.ignore) && !Array.isArray(options.ignore)) {
throw new TypeError('`ignore` should be an Array');
}

// Trim list of ignored variables
Expand Down

0 comments on commit 6da32e7

Please sign in to comment.