import { inflate , deflate } from 'pako' ; export const encode = ( string ) : string => btoa ( String . fromCharCode . apply ( null , deflate ( string ) ) ) ; export const decode = ( string ) : string => inflate ( new Uint8Array ( atob ( string ) . split ( '' ) . map ( ( character ) => character . charCodeAt ( 0 ) ) ) , { to : 'string' } ) ;