MCPcopy
hub / github.com/mozilla/source-map / SourceMapConsumerConstructor

Interface SourceMapConsumerConstructor

source-map.d.ts:219–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219export interface SourceMapConsumerConstructor {
220 prototype: SourceMapConsumer;
221
222 GENERATED_ORDER: number;
223 ORIGINAL_ORDER: number;
224 GREATEST_LOWER_BOUND: number;
225 LEAST_UPPER_BOUND: number;
226
227 new (
228 rawSourceMap: RawSourceMap,
229 sourceMapUrl?: SourceMapUrl
230 ): Promise<BasicSourceMapConsumer>;
231 new (
232 rawSourceMap: RawIndexMap,
233 sourceMapUrl?: SourceMapUrl
234 ): Promise<IndexedSourceMapConsumer>;
235 new (
236 rawSourceMap: RawSourceMap | RawIndexMap | string,
237 sourceMapUrl?: SourceMapUrl
238 ): Promise<BasicSourceMapConsumer | IndexedSourceMapConsumer>;
239
240 /**
241 * Create a BasicSourceMapConsumer from a SourceMapGenerator.
242 *
243 * @param sourceMap
244 * The source map that will be consumed.
245 */
246 fromSourceMap(
247 sourceMap: SourceMapGenerator,
248 sourceMapUrl?: SourceMapUrl
249 ): Promise<BasicSourceMapConsumer>;
250
251 /**
252 * Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl`
253 * (see the `SourceMapConsumer` constructor for details. Then, invoke the `async
254 * function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait
255 * for `f` to complete, call `destroy` on the consumer, and return `f`'s return
256 * value.
257 *
258 * You must not use the consumer after `f` completes!
259 *
260 * By using `with`, you do not have to remember to manually call `destroy` on
261 * the consumer, since it will be called automatically once `f` completes.
262 *
263 * ```js
264 * const xSquared = await SourceMapConsumer.with(
265 * myRawSourceMap,
266 * null,
267 * async function (consumer) {
268 * // Use `consumer` inside here and don't worry about remembering
269 * // to call `destroy`.
270 *
271 * const x = await whatever(consumer);
272 * return x * x;
273 * }
274 * );
275 *
276 * // You may not use that `consumer` anymore out here; it has

Callers 8

_factoryBSMFunction · 0.65
actualMapFunction · 0.65
bench.jsFile · 0.65
testMappingActionFunction · 0.65

Implementers 1

SourceMapConsumerlib/source-map-consumer.js

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…