@trapi/metadata
Version:
Generate REST-API metadata scheme from TypeScript Decorators.
32 lines • 1.13 kB
JavaScript
;
/*
* Copyright (c) 2023.
* Author Peter Placzek (tada5hi)
* For the full copyright and license information,
* view the LICENSE file that was distributed with this source code.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.scanSourceFiles = void 0;
const locter_1 = require("locter");
async function scanSourceFiles(input) {
const sources = Array.isArray(input) ? input : [input];
const result = new Set();
const promises = [];
for (let i = 0; i < sources.length; i++) {
const source = sources[i];
if (typeof source === 'string') {
promises.push((0, locter_1.locateMany)(source));
}
else {
promises.push((0, locter_1.locateMany)(source.pattern, { path: source.cwd }));
}
}
const groupMatches = await Promise.all(promises);
const matches = groupMatches.flat();
for (let j = 0; j < matches.length; j++) {
result.add((0, locter_1.buildFilePath)(matches[j]));
}
return Array.from(result);
}
exports.scanSourceFiles = scanSourceFiles;
//# sourceMappingURL=source-files.js.map