Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async _collectSources() {
const stats = await Promise.all(this.sources.map(src => fs.stat(src.idlPath)));
const files = [];
for (let i = 0; i < stats.length; ++i) {
if (stats[i].isDirectory()) {
const folderContents = await fs.readdir(this.sources[i].idlPath);
for (const file of folderContents) {
if (file.endsWith(".webidl")) {
files.push({
idlPath: path.join(this.sources[i].idlPath, file),
impl: this.sources[i].impl
});
}
}
} else {
files.push({
idlPath: this.sources[i].idlPath,
impl: this.sources[i].impl
});
}
}
return files;