MCPcopy Create free account
hub / github.com/browserify/static-module / getLineInfo

Function getLineInfo

bench/input.js:299–310  ·  view source on GitHub ↗
(input, offset)

Source from the content-addressed store, hash-verified

297// into.
298
299function getLineInfo(input, offset) {
300 for (var line = 1, cur = 0;;) {
301 lineBreakG.lastIndex = cur;
302 var match = lineBreakG.exec(input);
303 if (match && match.index < offset) {
304 ++line;
305 cur = match.index + match[0].length;
306 } else {
307 return new Position(line, offset - cur)
308 }
309 }
310}
311
312// A second optional argument can be given to further configure
313// the parser process. These options are recognized:

Callers 1

input.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…