datavzrd 2.64.0

A tool to create visual HTML reports from collections of CSV/TSV tables
1
2
3
4
5
6
7
8
9
10
11
use anyhow::Result;
use jsonm::packer::{PackOptions, Packer};
use lz_str::compress_to_utf16;
use serde_json::{json, Value};

pub(crate) fn compress(data: Value) -> Result<String> {
    let mut packer = Packer::new();
    let options = PackOptions::new();
    let jsonm = packer.pack(&data, &options)?;
    Ok(compress_to_utf16(&json!(jsonm).to_string()))
}