UNPKG

1.06 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var tslib_1 = require("tslib");
4var glob_1 = require("glob");
5var minimatch = require("minimatch");
6function find(pattern, options) {
7 if (options === void 0) { options = {}; }
8 return new Promise(function (resolve, reject) {
9 new glob_1.Glob(pattern, options, function (err, matches) {
10 if (err) {
11 reject(err);
12 }
13 else {
14 resolve(matches);
15 }
16 });
17 });
18}
19exports.find = find;
20function isMatch(pattern, path, options) {
21 if (options === void 0) { options = {}; }
22 return minimatch(path, pattern, options);
23}
24exports.isMatch = isMatch;
25function matcher(pattern, options) {
26 if (options === void 0) { options = {}; }
27 var args = options;
28 return function (path, options) {
29 if (options === void 0) { options = {}; }
30 return isMatch(pattern, path, tslib_1.__assign({}, args, options));
31 };
32}
33exports.matcher = matcher;
34//# sourceMappingURL=glob.js.map
\No newline at end of file