ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
17 lines (15 loc) • 420 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
// todo: tests
function getPreviousMatchingPos(text, pos, condition) {
while (pos > 0) {
const char = text[pos - 1];
if (!condition(char))
pos--;
else
break;
}
return pos;
}
exports.getPreviousMatchingPos = getPreviousMatchingPos;
//# sourceMappingURL=getPreviousMatchingPos.js.map