MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / readString

Function readString

packages/migrate/scripts/jnoj.ts:17–22  ·  view source on GitHub ↗
(length: number)

Source from the content-addressed store, hash-verified

15function parsePhpArray(serialized: string) {
16 const initial = serialized;
17 const readString = (length: number) => {
18 const buf = new TextEncoder().encode(serialized).slice(0, length);
19 const result = new TextDecoder().decode(buf);
20 serialized = serialized.slice(result.length);
21 return result;
22 };
23 const readInt = () => {
24 let val = 0;
25 if (!'0123456789'.includes(serialized[0])) throw new Error(`Expected number, got "${serialized[0]}", initial "${initial}"`);

Callers 1

parsePhpArrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected