mirror of
https://github.com/RGBCube/rgbcube.github.io
synced 2026-01-14 00:51:02 +00:00
19 lines
348 B
Rust
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()
|
|
}
|