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

Function getConsumer

packages/core/inspector_modules.ts:16–32  ·  view source on GitHub ↗
(mapPath: string, sourceMap: any)

Source from the content-addressed store, hash-verified

14let consumerCache: Map<string, any>;
15
16function getConsumer(mapPath: string, sourceMap: any) {
17 if (!consumerCache) {
18 consumerCache = new Map();
19 }
20 let c = consumerCache.get(mapPath);
21 if (!c) {
22 try {
23 c = new SourceMapConsumer(sourceMap);
24 consumerCache.set(mapPath, c);
25 } catch (error) {
26 // Keep quiet in production-like console; failures just fall back to original stack
27 console.debug && console.debug(`SourceMapConsumer failed for ${mapPath}:`, error);
28 return null;
29 }
30 }
31 return c;
32}
33
34function safeReadText(path: string): string | null {
35 try {

Callers 1

remapFrameFunction · 0.85

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected