(mapPath: string, sourceMap: any)
| 14 | let consumerCache: Map<string, any>; |
| 15 | |
| 16 | function 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 | |
| 34 | function safeReadText(path: string): string | null { |
| 35 | try { |
no test coverage detected