1
Fork 0
mirror of https://github.com/RGBCube/rgbcube.github.io synced 2026-01-14 00:51:02 +00:00
rgbcube.github.io/src/minify/js.rs
2023-12-20 22:27:35 +03:00

19 lines
348 B
Rust

use minify_js::{
Session,
TopLevelMode,
};
pub fn js<S: AsRef<str>>(input: S) -> String {
let session = Session::new();
let mut out = Vec::new();
minify_js::minify(
&session,
TopLevelMode::Module,
input.as_ref().as_bytes(),
&mut out,
)
.unwrap();
String::from_utf8(out).unwrap()
}