From 985cb054b758c180a9fa20c47db3d39dd91ce1b3 Mon Sep 17 00:00:00 2001 From: Josh Chappelow Date: Sun, 15 Sep 2024 22:42:40 +0900 Subject: [PATCH] trying to understand lru-cache error - remove get value --- packages/cli/src/metadataGeneration/extension.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/metadataGeneration/extension.ts b/packages/cli/src/metadataGeneration/extension.ts index c27286e3a..46c4f9b13 100644 --- a/packages/cli/src/metadataGeneration/extension.ts +++ b/packages/cli/src/metadataGeneration/extension.ts @@ -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');