UNPKG

refakts

Version:

TypeScript refactoring tool built for AI coding agents to perform precise refactoring operations via command line instead of requiring complete code regeneration.

22 lines 790 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.VariableScope = void 0; class VariableScope { findReferencesInSameScope(declarationNode, variableName) { const sourceFile = declarationNode.getSourceFile(); const references = []; sourceFile.forEachDescendant((node) => { if (this.isMatchingReference(node, variableName, declarationNode)) { references.push(node); } }); return references; } isMatchingReference(node, variableName, declarationNode) { return node.getKind() === 80 && node.getText() === variableName && node !== declarationNode; } } exports.VariableScope = VariableScope; //# sourceMappingURL=variable-scope.js.map