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
Mappingsstructure as needed withby_generated_location,by_original_location,compute_column_spans,original_location_for,generated_location_for, andall_generated_locations_foras needed. -
When finished with
Mappingsstructure, dispose of it withfree_mappings.
Functions§
- all_
generated_ locations_ for - Find all mappings for the given original location, and invoke the
mapping_callbackon each of them. - allocate_
mappings - Allocate space for a mappings string of the given size (in bytes).
- by_
generated_ location - Invoke the
mapping_callbackon each mapping in the givenMappingsstructure, in order of generated location. - by_
original_ location - Invoke the
mapping_callbackon each mapping in the givenMappingsstructure 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
Mappingsstructure. - 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
Mappingsstructure.