Skip to main content

Crate oak_source_map

Crate oak_source_map 

Source
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§

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_encode
Encodes a signed integer to VLQ Base64 string.

Type Aliases§

Result
Result type alias for source map operations.