Skip to content

Commit

Permalink
trying to understand lru-cache error - remove get value
Browse files Browse the repository at this point in the history
  • Loading branch information
chappelo committed Sep 15, 2024
1 parent d3c4da1 commit 985cb05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/metadataGeneration/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export function getExtensions(decorators: ts.Identifier[], metadataGenerator: Me

const [decoratorKeyArg, decoratorValueArg] = extensionDecorator.parent.arguments;

if (!ts.isStringLiteral(decoratorKeyArg)) {
if (!ts.isStringLiteral(decoratorKeyArg) && !ts.isIdentifier(decoratorKeyArg)) {
throw new Error('The first argument of @Extension must be a string');
}

const attributeKey = ts.isIdentifier(decoratorKeyArg) ? getInitializerValue(decoratorKeyArg, metadataGenerator.typeChecker) : decoratorKeyArg.text;
const attributeKey = decoratorKeyArg.text;

if (typeof attributeKey !== 'string') {
throw new Error('The first argument of @Extension must a string');
Expand Down

0 comments on commit 985cb05

Please sign in to comment.