MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / mergeByLabel

Function mergeByLabel

tests/loadtest/tools/dashboard/app.js:1110–1125  ·  view source on GitHub ↗
(leftItems, rightItems, getLabel)

Source from the content-addressed store, hash-verified

1108}
1109
1110function mergeByLabel(leftItems, rightItems, getLabel) {
1111 const map = new Map();
1112 leftItems.forEach((item) => {
1113 const label = getLabel(item);
1114 map.set(label, { label, left: item, right: null });
1115 });
1116 rightItems.forEach((item) => {
1117 const label = getLabel(item);
1118 if (map.has(label)) {
1119 map.get(label).right = item;
1120 } else {
1121 map.set(label, { label, left: null, right: item });
1122 }
1123 });
1124 return [...map.values()];
1125}
1126
1127function compareMetricRow(label, leftValue, rightValue, formatter) {
1128 const tone = buildCompareTone(leftValue, rightValue, formatter);

Callers 2

renderCompareThresholdsFunction · 0.85
renderCompareChecksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected