1
0
Fork 0
mirror of synced 2024-07-16 03:35:56 +12:00
budibase/packages/builder/cypress/support/queryLevelTransformerFunction.js

14 lines
293 B
JavaScript
Raw Normal View History

const breweries = data
const totals = {}
for (let brewery of breweries)
{const state = brewery.state
if (totals[state] == null)
{totals[state] = 1
} else
{totals[state]++
}
}
const entries = Object.entries(totals)
return entries.map(([state, count]) => ({ state, count }))