UNPKG

prettierx

Version:

prettierX - a less opinionated fork of the Prettier code formatter

11 lines (9 loc) 257 B
"use strict"; // Super inefficient, needs to be cached. module.exports = function (lineColumn, text) { let index = 0; for (let i = 0; i < lineColumn.line - 1; ++i) { index = text.indexOf("\n", index) + 1; } return index + lineColumn.column; };