Skip to content

Commit

Permalink
fix code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
flashdesignory committed Aug 2, 2024
1 parent 289134e commit 8145cce
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export function formatCode(
) {
return code.replace(/{{(.*?)}}/g, (match) => {
const name = match.split(/{{|}}/).filter(Boolean)[0];
return JSON.stringify(
args && name in args ? args?.[name] : optionalParams?.[name],
);
return JSON.stringify(args?.[name] ?? optionalParams?.[name]);
});
}

Expand Down

0 comments on commit 8145cce

Please sign in to comment.