Skip to content

Commit

Permalink
Merge pull request #16 from curbengh/micromatch
Browse files Browse the repository at this point in the history
Chore: replace minimatch with micromatch
  • Loading branch information
segayuu authored Aug 6, 2019
2 parents eeccc8e + f0d27b9 commit 4d312f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions lib/filter.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
'use strict';

const CleanCSS = require('clean-css');
const minimatch = require('minimatch');
const micromatch = require('micromatch');
const Promise = require('bluebird');

module.exports = function(str, data) {
const options = this.config.clean_css;
const path = data.path;
let exclude = options.exclude;
if (exclude && !Array.isArray(exclude)) exclude = [exclude];
const exclude = options.exclude;

if (path && exclude && exclude.length) {
for (let i = 0, len = exclude.length; i < len; i++) {
if (minimatch(path, exclude[i])) return str;
}
if (micromatch.isMatch(path, exclude, { basename: true })) return str;
}

return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dependencies": {
"bluebird": "^3.5.5",
"clean-css": "^4.2.1",
"minimatch": "^3.0.4"
"micromatch": "^4.0.2"
},
"devDependencies": {
"chai": "^4.2.0",
Expand Down

0 comments on commit 4d312f4

Please sign in to comment.