Skip to content

Commit 80bbde0

Browse files
authored
fix: should keep mappings field (#102)
1 parent a8d6635 commit 80bbde0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/source.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,7 @@ struct RawSourceMap {
337337
pub sources_content: Option<Vec<Option<Cow<'static, str>>>>,
338338
#[serde(skip_serializing_if = "Option::is_none")]
339339
pub names: Option<Vec<Option<Cow<'static, str>>>>,
340-
#[serde(skip_serializing_if = "Option::is_none")]
341-
pub mappings: Option<String>,
340+
pub mappings: String,
342341
}
343342

344343
impl RawSourceMap {
@@ -424,7 +423,7 @@ impl TryFrom<RawSourceMap> for SourceMap {
424423
.collect();
425424
Ok(Self {
426425
file: raw.file,
427-
mappings: raw.mappings.unwrap_or_default(),
426+
mappings: raw.mappings,
428427
sources,
429428
sources_content,
430429
names,
@@ -462,7 +461,7 @@ impl From<SourceMap> for RawSourceMap {
462461
.map(|s| (!s.is_empty()).then_some(s))
463462
.collect(),
464463
),
465-
mappings: (!map.mappings.is_empty()).then_some(map.mappings),
464+
mappings: map.mappings,
466465
}
467466
}
468467
}

0 commit comments

Comments
 (0)