Versions 161 to 162
new file, 150 lines
4+
6+export function storeJson(storage: GraphStateStorage, namespace: string, chunks: Iterable<string>): number {
70+
80+ const root = storage.read(namespace, "root") as { format: number; id: number; nodes: number } | undefined;
88+ private node(): { kind: string; count?: number; value?: unknown; number?: boolean; negativeZero?: boolean } {
92+ if (!node || !["array", "object", "string", "value"].includes(node.kind)) throw Error("invalid stored JSON node");
106+ if (node.kind !== "object" && node.kind !== "array") throw Error("stored JSON node is not a container");
112+ const id = this.storage.read(`${this.namespace}:edges`, JSON.stringify([this.id, String(key)]));
144+ if (typeof node.value !== "string" || Number.isNaN(Number(node.value))) throw Error("invalid stored JSON number");
147+ if (node.value === null || typeof node.value === "boolean" || typeof node.value === "number") return node.value;
- MCP
- compare on this site's /mcp
- CLI
- abso diff 161 162 server/src/stored-json.ts --json
- JSON
- /christopher/abso-core/compare/161..162?file=server%2Fsrc%2Fstored-json.ts&format=json