Skip to content

Commit

Permalink
files and extensions only accepts arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
kevva committed Jul 4, 2017
1 parent 7f83fb4 commit 0a3b078
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ const getGlob = (dir, opts) => {

let files = ['**'];

if (opts.files && !Array.isArray(opts.files)) {
throw new TypeError(`\`options.files\` must be an \`Array\`, not \`${typeof opts.files}\``);
}

if (opts.extensions && !Array.isArray(opts.extensions)) {
throw new TypeError(`\`options.extensions\` must be an \`Array\`, not \`${typeof opts.extensions}\``);
}

if (opts.files && opts.extensions) {
files = opts.files.map(x => addExtensions(x, opts.extensions));
} else if (opts.files) {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"devDependencies": {
"ava": "*",
"make-dir": "^1.0.0",
"mkdirp": "^0.5.1",
"rimraf": "^2.5.0",
"xo": "*"
}
Expand Down

0 comments on commit 0a3b078

Please sign in to comment.