Skip to content

Commit 6f60d50

Browse files
rishabhr4derberg
andauthored
refactor: used object.hasown instead of object.hasownproperty in generator.js (#1291)
Co-authored-by: Lukasz Gornicki <lpgornicki@gmail.com>
1 parent 074e520 commit 6f60d50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/generator/lib/generator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ class Generator {
759759
// Check if the filename dictates it should be separated
760760
let wasSeparated = false;
761761
for (const prop in fileNamesForSeparation) {
762-
if (Object.prototype.hasOwnProperty.call(fileNamesForSeparation, prop) && stats.name.includes(`$$${prop}$$`)) {
762+
if (Object.hasOwn(fileNamesForSeparation, prop) && stats.name.includes(`$$${prop}$$`)) {
763763
await this.generateSeparateFiles(asyncapiDocument, fileNamesForSeparation[prop], prop, stats.name, root);
764764
const templateFilePath = path.relative(this.templateContentDir, path.resolve(root, stats.name));
765765
fs.unlink(path.resolve(this.targetDir, templateFilePath), next);

0 commit comments

Comments
 (0)