Skip to content

Commit

Permalink
Fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aayushRedHat committed Jan 17, 2024
1 parent f32478e commit 2d4de58
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,16 +774,17 @@ class Generator {
* @param {String} template The template filename to replace.
* @param {String} fileName Name of the file to generate for each security schema.
* @param {String} baseDir Base directory of the given file name.
* @returns {Promise}
*/
async generateSeparateFiles(asyncapiDocument, array, template, fileName, baseDir) {
const promises = [];

Object.keys(array).forEach(async (name) => {
Object.keys(array).forEach((name) => {
const component = array[name];
promises.push(await this.generateSeparateFile(asyncapiDocument, name, component, template, fileName, baseDir));
promises.push(this.generateSeparateFile(asyncapiDocument, name, component, template, fileName, baseDir));
});

await Promise.all(promises);
return Promise.all(promises);
}

/**
Expand Down

0 comments on commit 2d4de58

Please sign in to comment.