Expand description
§oak-source-map
A high-performance Source Map v3 implementation for Rust.
§Features
- Full Source Map v3 specification support
- VLQ Base64 encoding/decoding
- Zero-copy parsing where possible
- Builder pattern for incremental construction
- Source map composition and manipulation
§Example
use oak_source_map::{SourceMap, SourceMapBuilder};
// Parse an existing source map
let json = r#"{"version":3,"sources":["foo.js"],"names":[],"mappings":"AAAA"}"#;
let sm = SourceMap::parse(json)?;
// Build a new source map
let mut builder = SourceMapBuilder::new();
builder.add_source("input.ts");
builder.add_mapping(0, 0, Some(0), Some(0), Some(0), None);
let output = builder.build();
Structs§
- Bounded
Mapping - A mapping with bounds information for efficient lookup.
- Mapping
- A single mapping entry in a source map.
- Segment
- A segment in the mappings string.
- Source
Map - Source Map v3 representation.
- Source
MapBuilder - Builder for incrementally constructing source maps.
- Source
MapComposer - Composer for combining multiple source maps.
- Source
MapDecoder - Decoder for efficient source map lookups.
- Source
MapMetadata - Metadata about a source map.
Enums§
- Source
MapError - Error type for source map operations.
- Source
MapInput - Input source for source map parsing.
Constants§
- DEFAULT_
SOURCE_ ROOT - The default source root.
- SOURCE_
MAP_ VERSION - Source Map version (always 3).
Functions§
- vlq_
decode - Decodes a VLQ Base64 string to a signed integer.
- vlq_
encode - Encodes a signed integer to VLQ Base64 string.
Type Aliases§
- Result
- Result type alias for source map operations.