MCPcopy Create free account
hub / github.com/ptmt/react-native-macos / lineToLineSourceMap

Function lineToLineSourceMap

local-cli/bundle/output/unbundle/util.js:23–38  ·  view source on GitHub ↗
(source: string, filename: string = '')

Source from the content-addressed store, hash-verified

21
22
23function lineToLineSourceMap(source: string, filename: string = ''): MappingsMap {
24 // The first line mapping in our package is the base64vlq code for zeros (A).
25 const firstLine = 'AAAA;';
26
27 // Most other lines in our mappings are all zeros (for module, column etc)
28 // except for the lineno mapping: curLineno - prevLineno = 1; Which is C.
29 const line = 'AACA;';
30
31 return {
32 file: filename,
33 mappings: firstLine + Array(countLines(source)).join(line),
34 sources: [filename],
35 names: [],
36 version: 3,
37 };
38}
39
40const wrapperEnd = wrappedCode => wrappedCode.indexOf('{') + 1;
41

Callers 1

combineSourceMapsFunction · 0.85

Calls 1

countLinesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…