file-position
Given a row/column number, return the index of that character within the whole string
Usage
filePosition(src)(row, column)
Pass filePosition
your source file src
as a string, and it'll return a function. This function takes a row
and a column
parameter to look up.
In return, you'll get a single index pointing to the character's position in the entire string.
var position =var fs =var file = fsvar getIndex =var column = 10var row = 5var index =
License
MIT. See LICENSE.md for details.