MCPcopy
hub / github.com/slowlydev/f1-dash / inflate

Function inflate

dashboard/src/lib/inflate.ts:3–17  ·  view source on GitHub ↗
(data: string)

Source from the content-addressed store, hash-verified

1import { inflateRaw } from "pako";
2
3export 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};

Callers 2

handleInitialFunction · 0.90
handleUpdateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected