A pure MoonBit ECMA-426 Source Map library and command-line toolkit.
moon update
moon test --target all --deny-warn
moon run --target native cmd/main -- validate examples/demo.min.js.mapmoon run --target native cmd/main -- \
lookup examples/demo.min.js.map --line 0 --column 4 --format jsonmoon run --target native cmd/main -- \
symbolize examples/demo.min.js.map examples/frames.txt///|
test "parse, validate and query" {
let json =
#|{"version":3,"sources":["src/main.ts"],"names":["main"],"mappings":"AAAAA"}
let document = @moon_sourcemap.parse_document(json)
assert_false(
@moon_sourcemap.diagnostics_have_errors(@moon_sourcemap.validate(document)),
)
let decoded = @moon_sourcemap.decode_document(document)
let mapping = @moon_sourcemap.original_position_for(
decoded,
generated=@moon_sourcemap.Position::new(line=0, column=0),
)
assert_true(mapping is Some(_))
}///|
test "build a map" {
let builder = @moon_sourcemap.SourceMapBuilder::new(file="bundle.js")
let source = builder.add_source(
url="src/main.ts",
content="export const answer = 42",
)
builder.add_mapping(
generated=@moon_sourcemap.Position::new(line=0, column=0),
source_index=source,
original_line=0,
original_column=0,
name="answer",
)
let document = builder.build()
assert_eq(document.version, 3)
}| 能力 | API |
|---|---|
| JSON 双向转换 | parse_document, encode_document |
| mappings 编解码 | decode_mappings, encode_mappings |
| 严格校验 | validate, validate_json, Diagnostic |
| 位置查询 | original_position_for, get_original_positions, generated_positions_for |
| 批量索引 | SourceMapConsumer |
| Index Map | decode_document, flatten |
| 生成 | SourceMapBuilder, encode_decoded |
| 两级构建 | compose, compose_with_options |
| 栈帧恢复 | parse_stack_frame, symbolize, symbolize_frame |
| 规范化变换 | canonicalize, slice_generated, concatenate |
moon-sourcemap validate <map> [--format text|json]
moon-sourcemap inspect <map> [--format text|json]
moon-sourcemap lookup <map> --line N --column N [--bias glb|lub | --all] [--strict]
moon-sourcemap flatten <map> -o <output>
moon-sourcemap compose <outer> <inner> -o <output>
moon-sourcemap symbolize <map> <frames> [--context N] [--strict] [--format text|json]moon 0.1.20261104 (940aa18 2026-11-04)
moonc v0.10.20+65efd5b93 (2026-11-05)
moonrun 0.1.20261104 (940aa18 2026-11-04)moon fmt --check
moon check --target all --deny-warn
moon build --target all --deny-warn
moon test --target all --deny-warn
moon info
git diff --exit-code
moon packagepub(all) suberror SourceMapError {
InvalidJson(message~ : String)
InvalidField(path~ : String, message~ : String)
InvalidVlq(offset~ : Int, message~ : String)
InvalidMappings(line~ : Int, segment~ : Int, offset~ : Int, message~ : String)
InvalidDocument(message~ : String)
Io(message~ : String)
} derive(Eq, Debug)#deprecated("`SourceMapError::equal` is deprecated, use `Eq::equal` instead.")
fn SourceMapError::equal(SourceMapError, SourceMapError) -> Bool#deprecated("`SourceMapError::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn SourceMapError::not_equal(x : SourceMapError, y : SourceMapError) -> Bool#deprecated("`SourceMapError::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn SourceMapError::to_repr(SourceMapError) -> Reprpub(all) struct ComposeOptions {
bias : LookupBias
missing : MissingMappingPolicy
preserve_outer_names : Bool
}pub(all) struct ComposeStats {
outer_mappings : Int
composed_mappings : Int
generated_only : Int
dropped : Int
}pub(all) struct ContextualSymbolizationReport {
frames : Array[ContextualSymbolizedFrame]
matched : Int
unmatched : Int
with_context : Int
} derive(Eq, Debug)#deprecated("`ContextualSymbolizationReport::equal` is deprecated, use `Eq::equal` instead.")
fn ContextualSymbolizationReport::equal(ContextualSymbolizationReport, ContextualSymbolizationReport) -> Boolfn ContextualSymbolizationReport::has_complete_context(self : ContextualSymbolizationReport) -> Bool#deprecated("`ContextualSymbolizationReport::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn ContextualSymbolizationReport::not_equal(x : ContextualSymbolizationReport, y : ContextualSymbolizationReport) -> Bool#deprecated("`ContextualSymbolizationReport::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn ContextualSymbolizationReport::to_repr(ContextualSymbolizationReport) -> Reprfn ContextualSymbolizationReport::unmatched_frames(self : ContextualSymbolizationReport) -> Array[StackFrame]pub(all) struct ContextualSymbolizedFrame {
result : SymbolizedFrame
context : SourceContext?
} derive(Eq, Debug)#deprecated("`ContextualSymbolizedFrame::equal` is deprecated, use `Eq::equal` instead.")
fn ContextualSymbolizedFrame::equal(ContextualSymbolizedFrame, ContextualSymbolizedFrame) -> Bool#deprecated("`ContextualSymbolizedFrame::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn ContextualSymbolizedFrame::not_equal(x : ContextualSymbolizedFrame, y : ContextualSymbolizedFrame) -> Bool#deprecated("`ContextualSymbolizedFrame::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn ContextualSymbolizedFrame::to_repr(ContextualSymbolizedFrame) -> Repr#deprecated("`DecodedSourceMap::equal` is deprecated, use `Eq::equal` instead.")
fn DecodedSourceMap::equal(DecodedSourceMap, DecodedSourceMap) -> Boolfn DecodedSourceMap::new(file? : String, sources? : Array[SourceEntry], mappings? : Array[Mapping]) -> DecodedSourceMap#deprecated("`DecodedSourceMap::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn DecodedSourceMap::not_equal(x : DecodedSourceMap, y : DecodedSourceMap) -> Bool#deprecated("`DecodedSourceMap::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn DecodedSourceMap::to_repr(DecodedSourceMap) -> Reprpub(all) struct Diagnostic {
severity : DiagnosticSeverity
code : String
message : String
path : String
mapping_line : Int?
segment : Int?
offset : Int?
} derive(Eq, Debug)#deprecated("`Diagnostic::equal` is deprecated, use `Eq::equal` instead.")
fn Diagnostic::equal(Diagnostic, Diagnostic) -> Boolfn Diagnostic::error(code~ : String, message~ : String, path? : String, mapping_line? : Int, segment? : Int, offset? : Int) -> Diagnostic#deprecated("`Diagnostic::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn Diagnostic::not_equal(x : Diagnostic, y : Diagnostic) -> Bool#deprecated("`Diagnostic::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn Diagnostic::to_repr(Diagnostic) -> Reprfn Diagnostic::warning(code~ : String, message~ : String, path? : String, mapping_line? : Int, segment? : Int, offset? : Int) -> Diagnostic#deprecated("`DiagnosticSeverity::equal` is deprecated, use `Eq::equal` instead.")
fn DiagnosticSeverity::equal(DiagnosticSeverity, DiagnosticSeverity) -> Bool#deprecated("`DiagnosticSeverity::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn DiagnosticSeverity::not_equal(x : DiagnosticSeverity, y : DiagnosticSeverity) -> Bool#deprecated("`DiagnosticSeverity::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn DiagnosticSeverity::to_repr(DiagnosticSeverity) -> Repr#deprecated("`DuplicateMappingPolicy::equal` is deprecated, use `Eq::equal` instead.")
fn DuplicateMappingPolicy::equal(DuplicateMappingPolicy, DuplicateMappingPolicy) -> Bool#deprecated("`DuplicateMappingPolicy::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn DuplicateMappingPolicy::not_equal(x : DuplicateMappingPolicy, y : DuplicateMappingPolicy) -> Bool#deprecated("`DuplicateMappingPolicy::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn DuplicateMappingPolicy::to_repr(DuplicateMappingPolicy) -> Repr#deprecated("`GeneratedLineUsage::equal` is deprecated, use `Eq::equal` instead.")
fn GeneratedLineUsage::equal(GeneratedLineUsage, GeneratedLineUsage) -> Bool#deprecated("`GeneratedLineUsage::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn GeneratedLineUsage::not_equal(x : GeneratedLineUsage, y : GeneratedLineUsage) -> Bool#deprecated("`GeneratedLineUsage::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn GeneratedLineUsage::to_repr(GeneratedLineUsage) -> Repr#deprecated("`GeneratedSpan::equal` is deprecated, use `Eq::equal` instead.")
fn GeneratedSpan::equal(GeneratedSpan, GeneratedSpan) -> Bool#deprecated("`GeneratedSpan::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn GeneratedSpan::not_equal(x : GeneratedSpan, y : GeneratedSpan) -> Bool#deprecated("`GeneratedSpan::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn GeneratedSpan::to_repr(GeneratedSpan) -> Repr#deprecated("`IndexSection::equal` is deprecated, use `Eq::equal` instead.")
fn IndexSection::equal(IndexSection, IndexSection) -> Bool#deprecated("`IndexSection::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn IndexSection::not_equal(x : IndexSection, y : IndexSection) -> Bool#deprecated("`IndexSection::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn IndexSection::to_repr(IndexSection) -> Reprpub(all) struct IndexSourceMap {
version : Int
file : String?
sections : Array[IndexSection]
} derive(Eq, Debug)#deprecated("`IndexSourceMap::equal` is deprecated, use `Eq::equal` instead.")
fn IndexSourceMap::equal(IndexSourceMap, IndexSourceMap) -> Bool#deprecated("`IndexSourceMap::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn IndexSourceMap::not_equal(x : IndexSourceMap, y : IndexSourceMap) -> Bool#deprecated("`IndexSourceMap::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn IndexSourceMap::to_repr(IndexSourceMap) -> Repr#deprecated("`LookupBias::equal` is deprecated, use `Eq::equal` instead.")
fn LookupBias::equal(LookupBias, LookupBias) -> Bool#deprecated("`LookupBias::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn LookupBias::not_equal(x : LookupBias, y : LookupBias) -> Bool#deprecated("`LookupBias::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn LookupBias::to_repr(LookupBias) -> Reprpub(all) struct Mapping {
generated : Position
original : OriginalPosition?
name : String?
} derive(Eq, Debug)#deprecated("`MissingMappingPolicy::equal` is deprecated, use `Eq::equal` instead.")
fn MissingMappingPolicy::equal(MissingMappingPolicy, MissingMappingPolicy) -> Bool#deprecated("`MissingMappingPolicy::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn MissingMappingPolicy::not_equal(x : MissingMappingPolicy, y : MissingMappingPolicy) -> Bool#deprecated("`MissingMappingPolicy::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn MissingMappingPolicy::to_repr(MissingMappingPolicy) -> Repr#deprecated("`OriginalPosition::equal` is deprecated, use `Eq::equal` instead.")
fn OriginalPosition::equal(OriginalPosition, OriginalPosition) -> Bool#deprecated("`OriginalPosition::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn OriginalPosition::not_equal(x : OriginalPosition, y : OriginalPosition) -> Bool#deprecated("`OriginalPosition::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn OriginalPosition::to_repr(OriginalPosition) -> Reprpub(all) struct RegisteredSourceMap {
name : String
generated_file : String
aliases : Array[String]
map : DecodedSourceMap
}#deprecated("`RegistryMissReason::equal` is deprecated, use `Eq::equal` instead.")
fn RegistryMissReason::equal(RegistryMissReason, RegistryMissReason) -> Bool#deprecated("`RegistryMissReason::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn RegistryMissReason::not_equal(x : RegistryMissReason, y : RegistryMissReason) -> Bool#deprecated("`RegistryMissReason::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn RegistryMissReason::to_repr(RegistryMissReason) -> Reprpub(all) struct RegistrySymbolizationReport {
frames : Array[RegistrySymbolizedFrame]
matched : Int
map_missing : Int
mapping_missing : Int
generated_only : Int
} derive(Eq, Debug)#deprecated("`RegistrySymbolizationReport::equal` is deprecated, use `Eq::equal` instead.")
fn RegistrySymbolizationReport::equal(RegistrySymbolizationReport, RegistrySymbolizationReport) -> Bool#deprecated("`RegistrySymbolizationReport::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn RegistrySymbolizationReport::not_equal(x : RegistrySymbolizationReport, y : RegistrySymbolizationReport) -> Bool#deprecated("`RegistrySymbolizationReport::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn RegistrySymbolizationReport::to_repr(RegistrySymbolizationReport) -> Reprpub(all) struct RegistrySymbolizedFrame {
frame : StackFrame
map_name : String?
result : SymbolizedFrame?
context : SourceContext?
miss_reason : RegistryMissReason?
} derive(Eq, Debug)#deprecated("`RegistrySymbolizedFrame::equal` is deprecated, use `Eq::equal` instead.")
fn RegistrySymbolizedFrame::equal(RegistrySymbolizedFrame, RegistrySymbolizedFrame) -> Bool#deprecated("`RegistrySymbolizedFrame::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn RegistrySymbolizedFrame::not_equal(x : RegistrySymbolizedFrame, y : RegistrySymbolizedFrame) -> Bool#deprecated("`RegistrySymbolizedFrame::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn RegistrySymbolizedFrame::to_repr(RegistrySymbolizedFrame) -> Repr#deprecated("`RegularSourceMap::equal` is deprecated, use `Eq::equal` instead.")
fn RegularSourceMap::equal(RegularSourceMap, RegularSourceMap) -> Boolfn RegularSourceMap::new(file? : String, source_root? : String, sources? : Array[String?], sources_content? : Array[String?], names? : Array[String], mappings? : String, ignore_list? : Array[Int]) -> RegularSourceMap#deprecated("`RegularSourceMap::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn RegularSourceMap::not_equal(x : RegularSourceMap, y : RegularSourceMap) -> Bool#deprecated("`RegularSourceMap::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn RegularSourceMap::to_repr(RegularSourceMap) -> Repr#deprecated("`SourceContext::equal` is deprecated, use `Eq::equal` instead.")
fn SourceContext::equal(SourceContext, SourceContext) -> Bool#deprecated("`SourceContext::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn SourceContext::not_equal(x : SourceContext, y : SourceContext) -> Bool#deprecated("`SourceContext::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn SourceContext::to_repr(SourceContext) -> Repr#deprecated("`SourceEntry::equal` is deprecated, use `Eq::equal` instead.")
fn SourceEntry::equal(SourceEntry, SourceEntry) -> Bool#deprecated("`SourceEntry::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn SourceEntry::not_equal(x : SourceEntry, y : SourceEntry) -> Bool#deprecated("`SourceEntry::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn SourceEntry::to_repr(SourceEntry) -> Repr#deprecated("`SourceLine::equal` is deprecated, use `Eq::equal` instead.")
fn SourceLine::equal(SourceLine, SourceLine) -> Bool#deprecated("`SourceLine::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn SourceLine::not_equal(x : SourceLine, y : SourceLine) -> Bool#deprecated("`SourceLine::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn SourceLine::to_repr(SourceLine) -> Reprpub(all) struct SourceMapBuilder {
file : String?
sources : Array[SourceEntry]
names : Array[String]
mappings : Array[Mapping]
}fn SourceMapBuilder::add_generated(self : SourceMapBuilder, generated~ : Position) -> Unit raise SourceMapErrorfn SourceMapBuilder::add_mapping(self : SourceMapBuilder, generated~ : Position, source_index~ : Int, original_line~ : Int, original_column~ : Int, name? : String) -> Unit raise SourceMapErrorfn SourceMapBuilder::add_source(self : SourceMapBuilder, url? : String, content? : String, ignored? : Bool) -> Intpub(all) struct SourceMapConsumer {
map : DecodedSourceMap
line_starts : Array[Int]
reverse : Map[Int, Array[Int]]
}fn SourceMapConsumer::from_document(document : SourceMapDocument, map_url? : String) -> SourceMapConsumer raise SourceMapErrorfn SourceMapConsumer::generated_positions_for(self : SourceMapConsumer, source_index~ : Int, line? : Int, column? : Int) -> Array[Mapping]fn SourceMapConsumer::get_original_positions(self : SourceMapConsumer, generated~ : Position) -> Array[OriginalPosition?]fn SourceMapConsumer::original_position_for(self : SourceMapConsumer, generated~ : Position, bias? : LookupBias) -> Mapping?fn SourceMapConsumer::original_positions_for(self : SourceMapConsumer, positions : ArrayView[Position], bias? : LookupBias) -> Array[Mapping?]pub(all) enum SourceMapDocument {
Regular(RegularSourceMap)
Indexed(IndexSourceMap)
} derive(Eq, Debug)#deprecated("`SourceMapDocument::equal` is deprecated, use `Eq::equal` instead.")
fn SourceMapDocument::equal(SourceMapDocument, SourceMapDocument) -> Bool#deprecated("`SourceMapDocument::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn SourceMapDocument::not_equal(x : SourceMapDocument, y : SourceMapDocument) -> Bool#deprecated("`SourceMapDocument::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn SourceMapDocument::to_repr(SourceMapDocument) -> Reprfn SourceMapRegistry::find(self : SourceMapRegistry, generated_file : String) -> RegisteredSourceMap?fn SourceMapRegistry::register(self : SourceMapRegistry, name~ : String, generated_file~ : String, map~ : DecodedSourceMap, aliases? : Array[String]) -> Unit raise SourceMapErrorfn SourceMapRegistry::symbolize(self : SourceMapRegistry, frames : String, bias? : LookupBias, context_radius? : Int) -> RegistrySymbolizationReport raise SourceMapErrorfn SourceMapRegistry::symbolize_frame(self : SourceMapRegistry, frame : StackFrame, bias? : LookupBias, context_radius? : Int) -> RegistrySymbolizedFramepub(all) struct SourceMapReport {
file : String?
sources : Int
mappings : Int
mapped_segments : Int
generated_only_segments : Int
named_segments : Int
ignored_sources : Int
embedded_sources : Int
referenced_sources : Int
unreferenced_sources : Int
generated_lines : Int
original_lines : Int
duplicate_positions : Int
open_spans : Int
source_usage : Array[SourceUsage]
generated_line_usage : Array[GeneratedLineUsage]
} derive(Eq, Debug)#deprecated("`SourceMapReport::equal` is deprecated, use `Eq::equal` instead.")
fn SourceMapReport::equal(SourceMapReport, SourceMapReport) -> Bool#deprecated("`SourceMapReport::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn SourceMapReport::not_equal(x : SourceMapReport, y : SourceMapReport) -> Bool#deprecated("`SourceMapReport::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn SourceMapReport::to_repr(SourceMapReport) -> Reprpub(all) struct SourceMapStats {
sources : Int
mappings : Int
mapped : Int
generated_only : Int
named : Int
ignored_sources : Int
generated_lines : Int
original_lines : Int
}#deprecated("`SourcePathKind::equal` is deprecated, use `Eq::equal` instead.")
fn SourcePathKind::equal(SourcePathKind, SourcePathKind) -> Bool#deprecated("`SourcePathKind::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn SourcePathKind::not_equal(x : SourcePathKind, y : SourcePathKind) -> Bool#deprecated("`SourcePathKind::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn SourcePathKind::to_repr(SourcePathKind) -> Reprpub(all) struct SourceResolverOptions {
map_url : String?
source_root : String?
normalize_windows : Bool
}fn SourceResolverOptions::new(map_url? : String, source_root? : String, normalize_windows? : Bool) -> SourceResolverOptionsfn SourceTextIndex::context(self : SourceTextIndex, source? : String, line~ : Int, column~ : Int, radius? : Int) -> SourceContext?#deprecated("`SourceUsage::equal` is deprecated, use `Eq::equal` instead.")
fn SourceUsage::equal(SourceUsage, SourceUsage) -> Bool#deprecated("`SourceUsage::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn SourceUsage::not_equal(x : SourceUsage, y : SourceUsage) -> Bool#deprecated("`SourceUsage::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn SourceUsage::to_repr(SourceUsage) -> Repr#deprecated("`StackFrame::equal` is deprecated, use `Eq::equal` instead.")
fn StackFrame::equal(StackFrame, StackFrame) -> Bool#deprecated("`StackFrame::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn StackFrame::not_equal(x : StackFrame, y : StackFrame) -> Bool#deprecated("`StackFrame::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn StackFrame::to_repr(StackFrame) -> Reprpub(all) struct SymbolizedFrame {
generated : StackFrame
source : String?
line : Int?
column : Int?
name : String?
ignored : Bool
matched : Bool
} derive(Eq, Debug)#deprecated("`SymbolizedFrame::equal` is deprecated, use `Eq::equal` instead.")
fn SymbolizedFrame::equal(SymbolizedFrame, SymbolizedFrame) -> Bool#deprecated("`SymbolizedFrame::not_equal` is deprecated, use `Eq::not_equal` instead.")
fn SymbolizedFrame::not_equal(x : SymbolizedFrame, y : SymbolizedFrame) -> Bool#deprecated("`SymbolizedFrame::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn SymbolizedFrame::to_repr(SymbolizedFrame) -> Reprpub(all) struct TransformReport {
mappings_before : Int
mappings_after : Int
sources_before : Int
sources_after : Int
duplicates_removed : Int
sources_removed : Int
}fn analyze_source_map_json(input : StringView, map_url? : String) -> SourceMapReport raise SourceMapErrorfn canonicalize(map : DecodedSourceMap, duplicate_policy? : DuplicateMappingPolicy, remove_unused_sources? : Bool) -> TransformResultfn compose(generated_to_intermediate : DecodedSourceMap, intermediate_to_original : DecodedSourceMap) -> DecodedSourceMapfn compose_json(outer_json : StringView, inner_json : StringView, indent? : Int) -> String raise SourceMapErrorfn compose_with_options(outer : DecodedSourceMap, inner : DecodedSourceMap, options? : ComposeOptions) -> ComposeResultfn concatenate(parts : ArrayView[(Position, DecodedSourceMap)], file? : String) -> DecodedSourceMap raise SourceMapErrorfn decode_document(document : SourceMapDocument, map_url? : String) -> DecodedSourceMap raise SourceMapErrorfn decode_mappings(input : String, sources_count~ : Int, names~ : ArrayView[String]) -> Array[Mapping] raise SourceMapErrorfn decode_regular_source_map(map : RegularSourceMap, map_url? : String) -> DecodedSourceMap raise SourceMapErrorfn encode_mappings(mappings : ArrayView[Mapping], names~ : ArrayView[String]) -> String raise SourceMapErrorfn encode_vlq(value : Int) -> Stringfn generated_positions_for(map : DecodedSourceMap, source_index~ : Int, line~ : Int, column? : Int) -> Array[Mapping]fn get_original_positions(map : DecodedSourceMap, generated~ : Position) -> Array[OriginalPosition?]fn mappings_line_count(input : String) -> Intfn normalize_generated_file(value : String) -> Stringfn original_position_for(map : DecodedSourceMap, generated~ : Position, bias? : LookupBias) -> Mapping?fn shift_generated(map : DecodedSourceMap, line_delta? : Int, first_line_column_delta? : Int) -> DecodedSourceMap raise SourceMapErrorfn slice_generated(map : DecodedSourceMap, start~ : Position, end~ : Position) -> DecodedSourceMap raise SourceMapErrorfn source_context_for_frame(map : DecodedSourceMap, frame : SymbolizedFrame, radius? : Int) -> SourceContext?fn source_context_for_mapping(map : DecodedSourceMap, mapping : Mapping, radius? : Int) -> SourceContext?fn symbolize(map : DecodedSourceMap, frames : String, bias? : LookupBias) -> Array[SymbolizedFrame] raise SourceMapErrorfn symbolize_frame(map : DecodedSourceMap, frame : StackFrame, bias? : LookupBias) -> SymbolizedFramefn symbolize_frame_with_context(map : DecodedSourceMap, frame : StackFrame, bias? : LookupBias, context_radius? : Int) -> ContextualSymbolizedFramefn symbolize_with_context(map : DecodedSourceMap, frames : String, bias? : LookupBias, context_radius? : Int) -> ContextualSymbolizationReport raise SourceMapErrorInstall
Download zipA pure MoonBit ECMA-426 Source Map library and command-line toolkit.