Skip to content

Commit

Permalink
fix: constant named as _ cannot be found
Browse files Browse the repository at this point in the history
  • Loading branch information
piquark6046 committed Aug 19, 2024
1 parent 1a647a4 commit 93f2f48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@list-kr/microshield-token-parser",
"type": "module",
"version": "1.0.2",
"version": "1.0.3",
"license": "Apache-2.0",
"scripts": {
"build": "pkgroll --src sources",
Expand Down
4 changes: 3 additions & 1 deletion sources/extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ export class AdvancedExtractor extends Extractor {

const TokenIdentifierNodes = FileInstance.getDescendantsOfKind(TsMorph.SyntaxKind.Identifier)
.filter(Identifier => {
return Identifier.getParent().getText().includes('_') && Identifier.getParent().getDescendantsOfKind(TsMorph.SyntaxKind.Identifier).length === 10
return Identifier.getParent().getDescendantsOfKind(TsMorph.SyntaxKind.Identifier).length === 10
&& typeof Identifier.getFirstAncestorByKind(TsMorph.SyntaxKind.ReturnStatement) !== 'undefined'
&& Identifier.getFirstAncestorByKind(TsMorph.SyntaxKind.ReturnStatement).getText().includes('.concat([')
})
TokenIdentifierNodes.forEach(TokenIdentifier => {
const TokenDeclarationNode = TokenIdentifier.findReferences()[0].getDefinition().getDeclarationNode()
Expand Down

0 comments on commit 93f2f48

Please sign in to comment.