mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-28 00:29:58 -07:00
global: BIG snapshot
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user