UNPKG

845 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var glob = require("glob");
4exports.documentsFromGlobs = function (documents) {
5 return Promise.all(documents.map(function (documentGlob) {
6 return new Promise(function (resolve, reject) {
7 glob(documentGlob, function (err, files) {
8 if (err) {
9 reject(err);
10 }
11 if (!files || files.length === 0) {
12 reject("Unable to locate files matching glob definition: " + documentGlob);
13 }
14 resolve(files);
15 });
16 });
17 }))
18 .then(function (files) {
19 return files.length === 0 ? [] : files.reduce(function (a, b) {
20 return a.concat(b);
21 });
22 });
23};
24//# sourceMappingURL=documents-glob.js.map
\No newline at end of file