Type Alias PlainValue

PlainValue:
    | null
    | boolean
    | number
    | string
    | readonly PlainValue[]
    | { readonly [key: string]: PlainValue }

A value in the plain form itinera keeps: null, a boolean, a finite number, a string, a list of plain values, or a plain object of them.

Whatever itinera stores or passes on, in the data bag, an event, a reason's details or global metadata, is plain: a SerialisesItself was turned into plain data when it was given. Types cannot tell a finite number from NaN or the infinities, nor see a cycle, so itinera also checks every value when it is given.

import assert from "node:assert/strict";
import type { PlainValue } from "itinera/value";

const order: PlainValue = {
id: "R-1",
lines: [{ sku: "tea", quantity: 2 }],
coupon: null,
};

assert.deepEqual(JSON.parse(JSON.stringify(order)), order);