Skip to content

Commit

Permalink
Inline: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
robisim74 committed Nov 23, 2022
1 parent bcc0692 commit 7f2c5a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/inline/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export function inline(
// Arguments
const args = expr.arguments;

if (args.length > 0) {
if (args?.length > 0) {
if (checkDynamic(args, originalFn)) continue;

const { defaultLang, supportedLangs } = withLang(args[3], opts);
Expand Down Expand Up @@ -321,7 +321,7 @@ export function checkDynamic(args: Argument[], originalFn: string): boolean {
if (args?.[0]?.value) {
// Dynamic key
if (args[0].type === 'Identifier') {
if (args[0].value === 'key') dynamicKeys.push(`dynamic key: ${originalFn.replace(/\s+/g, ' ')} - skip`)
if (args[0].value !== 'key') dynamicKeys.push(`dynamic key: ${originalFn.replace(/\s+/g, ' ')} - skip`)
return true;
}
if (args[0].type === 'Literal') {
Expand Down

0 comments on commit 7f2c5a9

Please sign in to comment.