Skip to main content

Crate oak_source_map

Crate oak_source_map 

Source
Expand description

Β§πŸ—ΊοΈ oak-source-map

Crates.io Documentation

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 representation
  • SourceMapBuilder β€” Incremental map construction
  • SourceMapComposer β€” Map composition for chained transformations
  • SourceMapDecoder β€” Parser for existing source maps
  • vlq β€” VLQ Base64 encoding/decoding utilities
  • mapping β€” 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Β§

BoundedMapping
A mapping with bounds information for efficient lookup.
Mapping
A single mapping entry in a source map.
Segment
A segment in the mappings string.
SourceMap
Source Map v3 representation.
SourceMapBuilder
Builder for incrementally constructing source maps.
SourceMapComposer
Composer for combining multiple source maps.
SourceMapDecoder
Decoder for efficient source map lookups.
SourceMapMetadata
Metadata about a source map.

EnumsΒ§

SourceMapError
Error type for source map operations.
SourceMapInput
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.