import { gzip , inflate } from "pako" ; export class Gzip { param object return public static toBase64 < T > ( object ) { return btoa ( gzip ( JSON . stringify ( object ) , { to : "string" } ) ) ; } param base64 return public static fromBase64 < T > ( base64 ) { return JSON . parse ( inflate ( atob ( base64 ) , { to : "string" } ) ) ; } param object return public static toBin < T > ( object ) { return gzip ( JSON . stringify ( object ) ) ; } param binary return public static fromBin < T > ( binary ) { return null ; } }