Skip to content

Commit

Permalink
Use arrify
Browse files Browse the repository at this point in the history
  • Loading branch information
kevva committed Jul 14, 2015
1 parent caa6caf commit d4a5259
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
9 changes: 3 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
var minimatch = require('minimatch');
var union = require('array-union');
var diff = require('array-differ');

function arrayify(arr) {
return Array.isArray(arr) ? arr : [arr];
}
var arrify = require('arrify');

module.exports = function (list, patterns, options) {
list = arrayify(list);
patterns = arrayify(patterns);
list = arrify(list);
patterns = arrify(patterns);

if (list.length === 0 || patterns.length === 0) {
return [];
Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"license": "MIT",
"repository": "sindresorhus/multimatch",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
"url": "http://sindresorhus.com"
},
"maintainers": [
Expand All @@ -25,21 +25,22 @@
"index.js"
],
"keywords": [
"minimatch",
"expand",
"find",
"glob",
"globbing",
"globs",
"match",
"matcher",
"minimatch",
"pattern",
"patterns",
"glob",
"globs",
"globbing",
"expand",
"wildcard",
"find"
"wildcard"
],
"dependencies": {
"array-differ": "^1.0.0",
"array-union": "^1.0.1",
"arrify": "^1.0.0",
"minimatch": "^2.0.1"
},
"devDependencies": {
Expand Down

0 comments on commit d4a5259

Please sign in to comment.