Public Variables and Functions
decode
function
Usage: (decode source-map)
(decode mappings source-map)
Convert a v3 source map JSON object into a nested sorted map
organized as file, line, and column. Note this source map
maps from *generated* source location to original source
location.
decode-reverse
function
Usage: (decode-reverse source-map)
(decode-reverse mappings source-map)
Convert a v3 source map JSON object into a nested sorted map
organized as file, line, and column. Note this source map
maps from *original* source location to generated source location.
encode
function
Usage: (encode m opts)
Take an internal source map representation represented as nested
sorted maps of file, line, column and return a source map v3 JSON
string.
encode*
function
Usage: (encode* m opts)
Take an internal source map representation represented as nested
sorted maps of file, line, column and return a v3 representation.
indexed-sources
function
Usage: (indexed-sources sources)
Take a seq of source file names and return a map from
file number to integer index.
invert-reverse-map
function
Usage: (invert-reverse-map reverse-map)
Given a ClojureScript to JavaScript source map, invert it. Useful when
mapping JavaScript stack traces when environment support is unavailable.
lines->segs
function
Usage: (lines->segs lines)
Take a nested sorted map encoding line and column information
for a file and return a vector of vectors of encoded segments.
Each vector represents a line, and the internal vectors are segments
representing the contents of the line.
merge-source-maps
function
Usage: (merge-source-maps cljs-map js-map)
Merge an internal source map representation of a single
ClojureScript file mapping original to generated with a
second source map mapping original JS to generated JS.
The is to support source maps that work through multiple
compilation steps like Google Closure optimization passes.
relativize-path
function
Usage: (relativize-path path {:keys [output-dir source-map-path source-map relpaths], :as opts})
Relativize a path using :source-map-path if provided or the parent directory
otherwise.
seg->map
function
Usage: (seg->map seg source-map)
Take a source map segment represented as a vector
and return a map.
seg-combine
function
Usage: (seg-combine seg relseg)
Combine a source map segment vector and a relative
source map segment vector and combine them to get
an absolute segment posititon information as a vector.
source-compare
function
Usage: (source-compare sources)
Take a seq of source file names and return a comparator
that can be used to construct a sorted map.
update-result
function
Usage: (update-result result segmap gline)
Helper for decode. Take a source map and update it based on a
segment map.
update-reverse-result
function
Usage: (update-reverse-result result segmap gline)
Helper for decode-reverse. Take a source map and update it
based on a segment map.