Expand description
Β§πΊοΈ oak-source-map
High-Performance Source Map v3 Implementation for Rust β A complete, zero-copy Source Map v3 implementation with VLQ encoding/decoding, builder patterns, and map composition.
Β§π― Why oak-source-map?
Source maps are essential for debugging bundled and minified code. oak-source-map provides a high-performance, feature-complete implementation of the Source Map v3 specification, designed for both parsing and generating source maps efficiently.
Β§β¨ Key Features
- π Full v3 Specification Support β Complete implementation of the Source Map v3 format
- β‘ VLQ Base64 Encoding/Decoding β Fast and efficient VLQ processing
- π Zero-Copy Parsing β Minimal memory overhead when parsing existing maps
- ποΈ Builder Pattern β Incremental source map construction
- π Source Map Composition β Combine multiple source maps for chained transformations
- π Mapping Lookup β Efficient line/column mapping queries
- π Serde Integration β Seamless serialization and deserialization
Β§ποΈ Architecture
SourceMapβ Core source map representationSourceMapBuilderβ Incremental map constructionSourceMapComposerβ Map composition for chained transformationsSourceMapDecoderβ Parser for existing source mapsvlqβ VLQ Base64 encoding/decoding utilitiesmappingβ Mapping and segment data structures
Β§π Ecosystem Integration
Used by Oak language tools for debugging support and by bundlers and minifiers in the Rust ecosystem.
Β§π Documentation
For usage examples and API details, see the API documentation.
Β§π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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_
decode_ many - Decodes multiple VLQ values from a string segment.
- vlq_
encode - Encodes a signed integer to VLQ Base64 string.
- vlq_
encode_ many - Encodes multiple values into a VLQ string with separators.
Type AliasesΒ§
- Result
- Result type alias for source map operations.