MCPcopy
hub / github.com/react/metro / generateFunctionMap

Function generateFunctionMap

packages/metro-source-map/src/generateFunctionMap.js:82–89  ·  view source on GitHub ↗

* Generate a map of source positions to function names. The names are meant to * describe the stack frame in an error trace and may contain more contextual * information than just the actual name of the function. * * The output is encoded for use in a source map. For details about the format, *

(
  ast: BabelNode,
  context?: Context,
)

Source from the content-addressed store, hash-verified

80 * see MappingEncoder below.
81 */
82function generateFunctionMap(
83 ast: BabelNode,
84 context?: Context,
85): FBSourceFunctionMap {
86 const encoder = new MappingEncoder();
87 forEachMapping(ast, context, mapping => encoder.push(mapping));
88 return encoder.getResult();
89}
90
91/**
92 * Same as generateFunctionMap, but returns the raw array of mappings instead

Callers 1

Calls 3

pushMethod · 0.95
getResultMethod · 0.95
forEachMappingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…