1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var tslib_1 = require("tslib");
|
4 | var glob_1 = require("glob");
|
5 | var minimatch = require("minimatch");
|
6 | function 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 | }
|
19 | exports.find = find;
|
20 | function isMatch(pattern, path, options) {
|
21 | if (options === void 0) { options = {}; }
|
22 | return minimatch(path, pattern, options);
|
23 | }
|
24 | exports.isMatch = isMatch;
|
25 | function 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 | }
|
33 | exports.matcher = matcher;
|
34 |
|
\ | No newline at end of file |