tamaki.mes.backup.compare.extractJsonFromBytes
Description
Extracts all JSON files from a configuration-backup ZIP supplied as a byte array: for example the
output of system.mes.util.backup(), or the bytes read by
extractJsonFromZip. The ZIP is opened in memory and every .json entry
is decoded with system.util.jsonDecode.
Syntax
tamaki.mes.backup.compare.extractJsonFromBytes(bytes)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
bytes | byte[] | False | A byte array of a backup ZIP (for example from system.mes.util.backup()). |
Returns
A Dict mapping each JSON file name (without the .json extension) to its parsed contents.
Code Examples
# Compare against the current database: take a live backup and extract its JSON
backupBytes = system.mes.util.backup()
oldJsonData = tamaki.mes.backup.compare.extractJsonFromBytes(backupBytes)