(data: string)
| 1 | import { inflateRaw } from "pako"; |
| 2 | |
| 3 | export const inflate = <T>(data: string): T => { |
| 4 | const binaryString = atob(data); |
| 5 | |
| 6 | const len = binaryString.length; |
| 7 | |
| 8 | const bytes = new Uint8Array(len); |
| 9 | |
| 10 | for (let i = 0; i < len; i++) { |
| 11 | bytes[i] = binaryString.charCodeAt(i); |
| 12 | } |
| 13 | |
| 14 | const inflatedData = inflateRaw(bytes, { to: "string" }); |
| 15 | |
| 16 | return JSON.parse(inflatedData); |
| 17 | }; |
no outgoing calls
no test coverage detected