Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

SaveCodec

Reads and writes one kind of value inside another owner’s key.

Type Parameter
Value
Property Modifier Type Description
form readonly number The form this release writes.
schema readonly ZodMiniType What a kept value must be: an object tagged with any form.

fromSave(saved): Value

A kept value, in any form a release wrote, as this release reads it. Throws for a form newer than this release’s, and for a value its schema refuses.

Parameter Type
saved unknown

Value


toSave(value): Value & object

The value as a key keeps it, tagged with its form.

Parameter Type
value Value

Value & object