MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / updatePosition

Function updatePosition

packages/core/css/lib/parse/index.ts:19–24  ·  view source on GitHub ↗

* Update lineno and column based on `str`.

(str)

Source from the content-addressed store, hash-verified

17 */
18
19 function updatePosition(str) {
20 var lines = str.match(/\n/g);
21 if (lines) lineno += lines.length;
22 var i = str.lastIndexOf('\n');
23 column = ~i ? str.length - i : column + str.length;
24 }
25
26 /**
27 * Mark position and patch `node.position`.

Callers 2

matchFunction · 0.85
commentFunction · 0.85

Calls 2

lastIndexOfMethod · 0.80
matchMethod · 0.45

Tested by

no test coverage detected