Skip to content

Commit

Permalink
refactor: used object.hasown instead of object.hasownproperty in gene…
Browse files Browse the repository at this point in the history
…rator.js (#1291)

Co-authored-by: Lukasz Gornicki <[email protected]>
  • Loading branch information
rishabhr4 and derberg authored Oct 9, 2024
1 parent 074e520 commit 6f60d50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/generator/lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ class Generator {
// Check if the filename dictates it should be separated
let wasSeparated = false;
for (const prop in fileNamesForSeparation) {
if (Object.prototype.hasOwnProperty.call(fileNamesForSeparation, prop) && stats.name.includes(`$$${prop}$$`)) {
if (Object.hasOwn(fileNamesForSeparation, prop) && stats.name.includes(`$$${prop}$$`)) {
await this.generateSeparateFiles(asyncapiDocument, fileNamesForSeparation[prop], prop, stats.name, root);
const templateFilePath = path.relative(this.templateContentDir, path.resolve(root, stats.name));
fs.unlink(path.resolve(this.targetDir, templateFilePath), next);
Expand Down

0 comments on commit 6f60d50

Please sign in to comment.