UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

23 lines (21 loc) 661 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function getPosAtNextNonBlankLine(text, pos) { let newPos = pos; for (let i = pos; i < text.length; i++) { if (text[i] === " " || text[i] === "\t") continue; if (text[i] === "\r" && text[i + 1] === "\n" || text[i] === "\n") { newPos = i + 1; if (text[i] === "\r") { i++; newPos++; } continue; } return newPos; } return newPos; } exports.getPosAtNextNonBlankLine = getPosAtNextNonBlankLine; //# sourceMappingURL=getPosAtNextNonBlankLine.js.map