How to use the lz-string.decompressFromUint8Array function in lz-string

To help you get started, we’ve selected a few lz-string examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vzhou842 / generals.io-Replay-Utils / converter.js View on Github external
function deserialize(serialized) {
	var obj = JSON.parse(
		LZString.decompressFromUint8Array(
			new Uint8Array(serialized)
		)
	);

	var replay = {};
	var i = 0;
	replay.version = obj[i++];
	replay.id = obj[i++];
	replay.mapWidth = obj[i++];
	replay.mapHeight = obj[i++];
	replay.usernames = obj[i++];
	replay.stars = obj[i++];
	replay.cities = obj[i++];
	replay.cityArmies = obj[i++]
	replay.generals = obj[i++];
	replay.mountains = obj[i++];
github react-pdf / site / src / lib / compress.js View on Github external
export const decompress = str => {
  const compressed = str.match(/.{2}/g).map(hexToDecimal);
  return LZString.decompressFromUint8Array(compressed);
};
github saltyshiomix / react-ssr / packages / core / lib / webpack / emotion.js View on Github external
const getProps = () => {
  const compressedProps = document.getElementById('react-ssr-script').dataset.props;
  const decoded = URLSafeBase64.decode(compressedProps);
  const decompressed = LZString.decompressFromUint8Array(decoded);
  return JSON.parse(decompressed);
}
github masotime / json-url / src / main / compress.js View on Github external
		decompress: async buffer => lzstring.decompressFromUint8Array(buffer)
	},
github saltyshiomix / react-ssr / packages / core / lib / webpack / material-ui.js View on Github external
const getProps = () => {
  const compressedProps = document.getElementById('react-ssr-script').dataset.props;
  const decoded = URLSafeBase64.decode(compressedProps);
  const decompressed = LZString.decompressFromUint8Array(decoded);
  return JSON.parse(decompressed);
}