MCPcopy Index your code
hub / github.com/css/csso / getOriginalPosition

Function getOriginalPosition

test/sourceMaps.js:12–29  ·  view source on GitHub ↗
(str, source, filename)

Source from the content-addressed store, hash-verified

10const points = ['.a', 'color', '.b', 'display', 'float'];
11
12function getOriginalPosition(str, source, filename) {
13 let index = source.indexOf(str);
14 let line = null;
15 let column = null;
16
17 if (index !== -1) {
18 var lines = source.substr(0, index).split('\n');
19 line = lines.length;
20 column = lines.pop().length;
21 }
22
23 return {
24 source: filename || '<unknown>',
25 line,
26 column,
27 name: null
28 };
29}
30
31function getGeneratedPosition(str, source) {
32 const index = source.indexOf(str);

Callers 1

sourceMaps.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…