Comparing version 0.7.3 to 0.7.4
21
index.js
@@ -10,2 +10,3 @@ 'use strict'; | ||
var globby = require('globby'); | ||
var mm = require('micromatch'); | ||
@@ -37,3 +38,3 @@ /** | ||
opts.cwd = opts.cwd ? path.resolve(opts.cwd) : process.cwd(); | ||
var files = glob(patterns, opts); | ||
var files = without(glob(patterns, opts), opts.ignored || []); | ||
@@ -69,3 +70,2 @@ if (opts.cache === true) { | ||
opts = opts || {}; | ||
if (typeof opts.glob === 'function') { | ||
@@ -123,1 +123,18 @@ return opts.glob(patterns, opts); | ||
} | ||
/** | ||
* Returns an array of file paths excluding | ||
* files that match the given glob patterns. | ||
*/ | ||
function without(files, patterns) { | ||
var len = files.length, res = []; | ||
while (len--) { | ||
var fp = files[len]; | ||
if (mm.any(fp, patterns)) { | ||
continue; | ||
} | ||
res.push(fp); | ||
} | ||
return res; | ||
} |
{ | ||
"name": "map-files", | ||
"description": "Return an object for a glob of files. Pass a `rename` function for the keys, or a `parse` function for the content, allowing it to be used for readable or require-able files.", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"homepage": "https://github.com/jonschlinkert/map-files", | ||
@@ -32,3 +32,4 @@ "author": { | ||
"dependencies": { | ||
"globby": "^1.2.0" | ||
"globby": "^1.2.0", | ||
"micromatch": "^2.1.5" | ||
}, | ||
@@ -35,0 +36,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9229
116
2
+ Addedmicromatch@^2.1.5
+ Addedarr-diff@2.0.0(transitive)
+ Addedarr-flatten@1.1.0(transitive)
+ Addedarray-unique@0.2.1(transitive)
+ Addedbraces@1.8.5(transitive)
+ Addedexpand-brackets@0.1.5(transitive)
+ Addedexpand-range@1.8.2(transitive)
+ Addedextglob@0.3.2(transitive)
+ Addedfilename-regex@2.0.1(transitive)
+ Addedfill-range@2.2.4(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedfor-own@0.1.5(transitive)
+ Addedglob-base@0.3.0(transitive)
+ Addedglob-parent@2.0.0(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-dotfile@1.0.3(transitive)
+ Addedis-equal-shallow@0.1.3(transitive)
+ Addedis-extendable@0.1.1(transitive)
+ Addedis-extglob@1.0.0(transitive)
+ Addedis-glob@2.0.1(transitive)
+ Addedis-number@2.1.04.0.0(transitive)
+ Addedis-posix-bracket@0.1.1(transitive)
+ Addedis-primitive@2.0.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisobject@2.1.0(transitive)
+ Addedkind-of@3.2.26.0.3(transitive)
+ Addedmath-random@1.0.4(transitive)
+ Addedmicromatch@2.3.11(transitive)
+ Addednormalize-path@2.1.1(transitive)
+ Addedobject.omit@2.0.1(transitive)
+ Addedparse-glob@3.0.4(transitive)
+ Addedpreserve@0.2.0(transitive)
+ Addedrandomatic@3.1.1(transitive)
+ Addedregex-cache@0.4.4(transitive)
+ Addedremove-trailing-separator@1.1.0(transitive)
+ Addedrepeat-element@1.1.4(transitive)
+ Addedrepeat-string@1.6.1(transitive)