Expand description
The public JS API to the source-map-mappings
crate.
§Usage
-
Instantiate the WebAssembly module, supplying a JS implementation of
mapping_callback
. -
Allocate space for the mappings string with
allocate_mappings
. -
Initialize the mappings string by copying the JS
String
’s data into it. -
Parse the mappings with
parse_mappings
. Handle errors, if any. -
Query the resulting
Mappings
structure as needed withby_generated_location
,by_original_location
,compute_column_spans
,original_location_for
,generated_location_for
, andall_generated_locations_for
as needed. -
When finished with
Mappings
structure, dispose of it withfree_mappings
.
Functions§
- all_
generated_ locations_ for - Find all mappings for the given original location, and invoke the
mapping_callback
on each of them. - allocate_
mappings - Allocate space for a mappings string of the given size (in bytes).
- by_
generated_ location - Invoke the
mapping_callback
on each mapping in the givenMappings
structure, in order of generated location. - by_
original_ location - Invoke the
mapping_callback
on each mapping in the givenMappings
structure that has original location information, in order of original location. - compute_
column_ spans - Compute column spans for the given mappings.
- free_
mappings - Destroy the given
Mappings
structure. - generated_
location_ for - Find the mapping for the given original location, if any exists.
- get_
last_ error - Get the last error’s error code, or 0 if there was none.
- original_
location_ for - Find the mapping for the given generated location, if any exists.
- parse_
mappings - Parse the given initialized mappings string into a
Mappings
structure.