global: BIG snapshot

This commit is contained in:
nym21
2026-01-04 01:47:03 +01:00
parent c33444a92e
commit 3cae817915
127 changed files with 4750 additions and 9474 deletions

View File

@@ -48,10 +48,16 @@ export function initOptions({ colors, signals, brk, qrcode }) {
* @param {AnyFetchedSeriesBlueprint[]} [arr]
*/
function arrayToRecord(arr = []) {
return (arr || []).reduce((record, blueprint) => {
return [...(arr || [])].reduce((record, blueprint) => {
if (!blueprint.metric) {
throw new Error(
`Blueprint missing metric: ${JSON.stringify(blueprint)}`,
);
}
markUsed(blueprint.metric);
// Use any index's path - unit is the same regardless of index (e.g., supply is "sats" for both height and dateindex)
const unit = blueprint.unit ?? serdeUnit.deserialize(blueprint.metric.name);
const unit =
blueprint.unit ?? serdeUnit.deserialize(blueprint.metric.name);
record[unit] ??= [];
record[unit].push(blueprint);
return record;