oak-source-map 0.0.6

High-performance Source Map v3 implementation for Rust
Documentation

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();

# Ok::<(), oak_source_map::SourceMapError>(())