Skip to content

Commit

Permalink
feat: to_writer in SourceMap
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Dec 3, 2024
1 parent a3bbc58 commit 3a1d231
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,12 @@ impl SourceMap {
let json = simd_json::serde::to_string(&self)?;
Ok(json)
}

/// Generate source map to writer.
pub fn to_writer<W: std::io::Write>(self, w: W) -> Result<()> {
simd_json::serde::to_writer(w, &self)?;
Ok(())
}
}

impl TryFrom<RawSourceMap> for SourceMap {
Expand Down

0 comments on commit 3a1d231

Please sign in to comment.