Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ pub struct SourceMap {
source_root: Option<Arc<str>>,
#[serde(rename = "debugId", skip_serializing_if = "Option::is_none")]
debug_id: Option<Arc<str>>,
#[serde(rename = "ignoreList", skip_serializing_if = "Option::is_none")]
ignore_list: Option<Vec<u32>>,
}

impl Hash for SourceMap {
Expand All @@ -218,6 +220,7 @@ impl Hash for SourceMap {
self.sources_content.hash(state);
self.names.hash(state);
self.source_root.hash(state);
self.ignore_list.hash(state);
}
}

Expand All @@ -244,6 +247,7 @@ impl SourceMap {
names: names.into(),
source_root: None,
debug_id: None,
ignore_list: None,
}
}

Expand All @@ -257,6 +261,16 @@ impl SourceMap {
self.file = file.map(Into::into);
}

/// Get the ignoreList field in [SourceMap].
pub fn ignore_list(&self) -> Option<&Vec<u32>> {
self.ignore_list.as_ref()
}

/// Set the ignoreList field in [SourceMap].
pub fn set_ignore_list(&mut self, ignore_list: Option<Vec<u32>>) {
self.ignore_list = ignore_list;
}

/// Get the decoded mappings in [SourceMap].
pub fn decoded_mappings(&self) -> impl Iterator<Item = Mapping> + '_ {
decode_mappings(self)
Expand Down Expand Up @@ -348,6 +362,8 @@ struct RawSourceMap {
pub mappings: String,
#[serde(rename = "debugId")]
pub debug_id: Option<String>,
#[serde(rename = "ignoreList")]
pub ignore_list: Option<Vec<u32>>,
}

impl RawSourceMap {
Expand Down Expand Up @@ -437,6 +453,7 @@ impl TryFrom<RawSourceMap> for SourceMap {
names,
source_root,
debug_id,
ignore_list: raw.ignore_list,
})
}
}
Expand Down
Loading