Narra

Reference

std/json

std/json

Parse and write JSON text as a Value of std/shape, or as any Shape type.

narra
import * as Json from "std/json"

The guide teaches it in chapter 7, Traits.

This page is generated by scripts/std/generate.nra from narrac query --json interface std/json. Do not edit it.

Functions

parse

narra
export function parse(text: string): Result<Value, string> uses alloc

Effects: alloc.

stringify

narra
export function stringify(value: Value): string uses alloc

Effects: alloc.

encode

narra
export function encode<T: Shape>(value: T): string uses alloc

Effects: alloc.

decode

narra
export function decode<T: Shape>(text: string): Result<T, string> uses alloc

Effects: alloc.