Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const compress = str =>
LZString.compressToUint8Array(str).reduce(
(acc, value) => `${acc}${decimalToHex(value)}`,
'',
);
const compressProps = (props: any) => {
const packed = JSON.stringify(props);
const compressed = Buffer.from(LZString.compressToUint8Array(packed));
return URLSafeBase64.encode(compressed);
}
const compressProps = (props: any) => {
const packed = JSON.stringify(props);
const compressed = Buffer.from(LZString.compressToUint8Array(packed));
return URLSafeBase64.encode(compressed);
}
compress: async string => Buffer.from(lzstring.compressToUint8Array(string)),
decompress: async buffer => lzstring.decompressFromUint8Array(buffer)