compress-payload
Utiliy for compressing and decompressing RUM payload data using Compression and Decompression streams. This module is based on Compression Streams specification.
API
; const payloadObject = /*Huge JSON RUM data*/;const payload = JSON;const compressedBlob = await ;const decompressedBlob = await ; // View the original payload contentconst originalPayload = await ;
compress(payload, type)
Compress the payload using the CompressionStream
. type
denotes either gzip
or deflate
. (default - gzip)
decompress(blob, type)
Decompress the compressed blob data extracted by calling compress(payload, data)
view(blob)
Read the entire contents of the blob interpreted as UTF-8 text.