TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Fixes: https://github.com/dsherret/ts-morph/issues/1591 Note that using `.pos` matches what typescript is doing as well: ``` function visitNodes2(nodes, visitor, test, start, count) { if (nodes === void 0) { return nodes; } const length2 = nodes.length; if (start === void 0 || start < 0) { start = 0; } if (count === void 0 || count > length2 - start) { count = length2 - start; } let hasTrailingComma; let pos = -1; let end = -1; if (start > 0 || count < length2) { hasTrailingComma = nodes.hasTrailingComma && start + count === length2; } else { pos = nodes.pos; end = nodes.end; hasTrailingComma = nodes.hasTrailingComma; } const updated = visitArrayWorker(nodes, visitor, test, start, count); if (updated !== nodes) { const updatedArray = factory.createNodeArray(updated, hasTrailingComma); setTextRangePosEnd(updatedArray, pos, end); return updatedArray; } return nodes; } ``` The line: ``` const updated = visitArrayWorker(nodes, visitor, test, start, count); ``` is calling `visitArrayWorker` which calls `innerVisit` which first calls the transform function followed by the handleTransformation function. So, on the way out typescript is using `.pos` as well.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by ofersadgat and has received 1 comments.