MCPcopy Create free account
hub / github.com/EvoMap/evolver / countBy

Function countBy

src/webui/observer/assets.js:109–117  ·  view source on GitHub ↗
(items, keyOrFn)

Source from the content-addressed store, hash-verified

107}
108
109function countBy(items, keyOrFn) {
110 const counts = {};
111 for (const item of items) {
112 const key = typeof keyOrFn === 'function' ? keyOrFn(item) : item && item[keyOrFn];
113 const safeKey = key || 'unknown';
114 counts[safeKey] = (counts[safeKey] || 0) + 1;
115 }
116 return counts;
117}
118
119function filterText(items, q) {
120 if (!q) return items;

Callers 3

getAssetOverviewFunction · 0.85
listGenesFunction · 0.85
listCapsulesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected