Sha256: 985c7e8885ffc3fba110be4fbdf74833d8e5c7d87f4d0648f80da1159aebd2e8
Contents?: true
Size: 455 Bytes
Versions: 5
Compression:
Stored size: 455 Bytes
Contents
module.exports = { getLocation: function(index, inputStream) { var n = index + 1, line = null, column = -1; while (--n >= 0 && inputStream.charAt(n) !== '\n') { column++; } if (typeof index === 'number') { line = (inputStream.slice(0, index).match(/\n/g) || "").length; } return { line: line, column: column }; } };
Version data entries
5 entries across 5 versions & 2 rubygems