Skip to content

Commit

Permalink
Merge branch 'master' into pref/dockerfile-optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
asyncapi-bot authored Oct 23, 2024
2 parents 4cfe688 + aa79245 commit 0420a04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/generator/lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ class Generator {
const shouldOverwriteFile = await this.shouldOverwriteFile(relativeTargetFile);
if (!shouldOverwriteFile) return;

if (this.templateConfig.conditionalFiles && this.templateConfig.conditionalFiles[relativeSourceFile]) {
if (this.templateConfig.conditionalFiles?.[relativeSourceFile]) {
const server = this.templateParams.server && asyncapiDocument.servers().get(this.templateParams.server);
const source = jmespath.search({
...asyncapiDocument.json(),
Expand Down
2 changes: 1 addition & 1 deletion apps/generator/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ utils.getGeneratorVersion = () => {
* @returns {Boolean} is function asynchronous
*/
utils.isAsyncFunction = (fn) => {
return fn && fn.constructor && fn.constructor.name === 'AsyncFunction';
return fn?.constructor?.name === 'AsyncFunction';
};

/**
Expand Down

0 comments on commit 0420a04

Please sign in to comment.