[feat] use msgpackr packr

This commit is contained in:
kwaroran
2023-06-24 01:00:06 +09:00
parent 8c2eb4b267
commit 58c4c05f83

View File

@@ -1,11 +1,13 @@
import { decode, encode } from "msgpackr";
import { Packr, decode } from "msgpackr";
import pako from "pako";
import { isTauri } from "./globalApi";
const packr = new Packr({
useRecords:true
});
export function encodeRisuSave(data:any){
const encoded = encode(data)
const encoded = packr.encode(data)
if(isTauri){
return pako.deflate(encoded)
}