Skip to main content

Function: schemaFromDump()

schemaFromDump(dump, gameVersion?): SaveSchema

Defined in: artifacts.ts:140

Derives a schema from an IndexedDB record copied out of a browser.

Accepts any of:

  • a whole saves table copy (an array of records)
  • one record, such as the __SYSTEM_INITIAL_STATE__ row
  • a bare state object, in which case gameVersion is required

Parameters

dump

unknown

Parsed JSON from the browser

gameVersion?

string

Required only for a bare state object or a mixed dump

Returns

SaveSchema

The derived schema

Throws

Error if the dump holds no recognisable state