mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-01 05:23:22 +00:00
15 lines
384 B
TypeScript
15 lines
384 B
TypeScript
import pako from 'pako';
|
|
|
|
export const decompressToJson = (base64string: string) => {
|
|
const base64_decoded = atob(base64string);
|
|
const charData = base64_decoded.split('').map(function (x) {
|
|
return x.charCodeAt(0);
|
|
});
|
|
const zlibData = new Uint8Array(charData);
|
|
const inflatedData = pako.inflate(zlibData, {
|
|
to: 'string',
|
|
});
|
|
|
|
return JSON.parse(inflatedData);
|
|
};
|