Skip to main content

Function: parse()

parse(value): Promise<any>

Defined in: index.ts:70

Restore value from JSON string.

Inverse of stringify(). Reconstructs all types including cycles and aliases.

This is a convenience wrapper around JSON.parse() + postprocess().

Parameters

value

string

JSON string in tuple $lmz format

Returns

Promise<any>

Restored value with all types and references preserved

Example

const json = await stringify({ name: "Alice", tags: ["dev", "js"] });
const restored = await parse(json);
console.log(restored.tags[0]); // "dev"