Website/node_modules/metalsmith-uglify/lib/match-pos.js
2015-12-02 18:21:44 -05:00

15 lines
260 B
JavaScript

'use strict';
var minimatch = require('minimatch');
module.exports = function matchPos(str, patterns) {
var pos = -1;
patterns.some(function (pattern, i) {
if (minimatch(str, pattern)) {
pos = i;
return true;
}
});
return pos;
};