MapStore(opts)

tracks source maps for registered files

Parameters

  • Object opts :

    [opts=undefined] options.

    • Boolean opts.verbose

      [opts.verbose=false] verbose mode

    • String opts.baseDir

      [opts.baseDir=null] alternate base directory to resolve sourcemap files

    • String opts.sourceStore

      [opts.sourceStore='memory'] - store that tracks embedded sources found in source maps, one of 'memory' or 'file'

    • String opts.tmpdir

      [opts.tmpdir=undefined] - temporary directory to use for storing files.

Instance members

#dispose

disposes temporary resources allocated by this map store

dispose

disposes temporary resources allocated by this map store

#registerMap(transformedFilePath, sourceMap)

registers a source map object with this store. Makes some basic sanity checks and silently fails on malformed input.

registerMap(transformedFilePath, sourceMap)

registers a source map object with this store. Makes some basic sanity checks and silently fails on malformed input.

Parameters

  • transformedFilePath :

    the file path for which the source map is valid

  • sourceMap :

    the source map object

#registerURL(transformedFilePath, sourceMapUrl)

registers a source map URL with this store. It makes some input sanity checks and silently fails on malformed input.

registerURL(transformedFilePath, sourceMapUrl)

registers a source map URL with this store. It makes some input sanity checks and silently fails on malformed input.

Parameters

  • transformedFilePath :

    the file path for which the source map is valid. This must exactly match the path stashed for the coverage object to be useful.

  • sourceMapUrl :

    the source map URL, not a comment

#transformCoverage(coverageMap)

transforms the coverage map provided into one that refers to original sources when valid mappings have been registered with this store.

transformCoverage(coverageMap)

transforms the coverage map provided into one that refers to original sources when valid mappings have been registered with this store.

Parameters

  • CoverageMap coverageMap :

    the coverage map to transform

Returns

Object :

an object with 2 properties. map for the transformed coverage map and sourceFinder which is a function to return the source text for a file.

Exports(opts)

Parameters

  • opts :

getMapping(sourceMap, location, origFile)

determines the original position for a given location

Parameters

  • SourceMapConsumer sourceMap :

    the source map

  • Object location :

    the original location Object

  • origFile :

Returns

Object :

the remapped location Object