Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuel-ferdman authored Oct 21, 2024
2 parents c993f2e + aa79245 commit 9fcfc0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 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
6 changes: 4 additions & 2 deletions apps/nunjucks-filters/src/customFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ function docline(field, fieldName, scopePropName) {
const getPName = (pName) => pName ? `${pName}.` : '';

const buildLineCore = (type, def, pName, fName) => {
return `* @param {${type}} ${pName}${fName}${def !== undefined ? `=${def}` : ''}`;
const paramName = `${pName}${fName}`;
const defaultValue = def !== undefined ? `=${def}` : '';
return `* @param {${type}} ${paramName}${defaultValue}`;
};

const buildLine = (f, fName, pName) => {
const type = getType(f);
const def = getDefault(f, type);
Expand Down

0 comments on commit 9fcfc0a

Please sign in to comment.