Skip to content

Commit

Permalink
Revert "Unnecessary escape character ' \$ 'were removed"
Browse files Browse the repository at this point in the history
This reverts commit 0fc7853.
  • Loading branch information
Light13008 committed Oct 6, 2024
1 parent 0fc7853 commit 1cb101e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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.hasOwn(fileNamesForSeparation, prop) && stats.name.includes(`$$${prop}$$`)) {
if (Object.prototype.hasOwnProperty.call(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 Expand Up @@ -822,7 +822,7 @@ class Generator {
filename = filenamify(filename, { replacement: '-', maxLength: 255 });
}

const newFileName = fileName.replace(`$$${template}$$`, filename);
const newFileName = fileName.replace(`\$\$${template}\$\$`, filename);
const targetFile = path.resolve(this.targetDir, relativeBaseDir, newFileName);
const relativeTargetFile = path.relative(this.targetDir, targetFile);
const shouldOverwriteFile = await this.shouldOverwriteFile(relativeTargetFile);
Expand Down

0 comments on commit 1cb101e

Please sign in to comment.