Skip to content

@statesync/persistence


@statesync/persistence / lzDecompress

Function: lzDecompress() ​

ts
function lzDecompress(compressed): string;

Defined in: persistence/src/compression.ts:86

Decompress a string that was previously compressed with lzCompress.

Parameters ​

ParameterTypeDescription
compressedstringThe compressed string to decompress. Returns an empty string if input is falsy.

Returns ​

string

The original uncompressed string.

Throws ​

If the compressed data is invalid or corrupt.

Example ​

typescript
const original = lzDecompress(compressed);

Released under the MIT License.