From 2ad64d9335288bb3aaeec40c1c7222f36569cb42 Mon Sep 17 00:00:00 2001 From: piquark6046 Date: Mon, 19 Aug 2024 14:10:22 +0000 Subject: [PATCH] fix: concat identifier cannot be found --- package.json | 2 +- sources/extractor.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b35a679..b2200fd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@list-kr/microshield-token-parser", "type": "module", - "version": "1.0.3", + "version": "1.0.4", "license": "Apache-2.0", "scripts": { "build": "pkgroll --src sources", diff --git a/sources/extractor.ts b/sources/extractor.ts index 74e240c..6f152b5 100644 --- a/sources/extractor.ts +++ b/sources/extractor.ts @@ -110,7 +110,9 @@ export class AdvancedExtractor extends Extractor { .filter(Identifier => { return Identifier.getParent().getDescendantsOfKind(TsMorph.SyntaxKind.Identifier).length === 10 && typeof Identifier.getFirstAncestorByKind(TsMorph.SyntaxKind.ReturnStatement) !== 'undefined' - && Identifier.getFirstAncestorByKind(TsMorph.SyntaxKind.ReturnStatement).getText().includes('.concat([') + && (Identifier.getFirstAncestorByKind(TsMorph.SyntaxKind.ReturnStatement).getText().includes('.concat([') + || Identifier.getFirstAncestorByKind(TsMorph.SyntaxKind.ReturnStatement).getText().includes('/resources/') + || Identifier.getFirstAncestorByKind(TsMorph.SyntaxKind.ReturnStatement).getText().includes('.endpoint')) }) TokenIdentifierNodes.forEach(TokenIdentifier => { const TokenDeclarationNode = TokenIdentifier.findReferences()[0].getDefinition().getDeclarationNode()