@gigsboat/cli
Version:
Do you have a boatload of speaking gigs? Use this CLI to manage them all!
20 lines (15 loc) • 405 B
JavaScript
export async function getJsonFormat({ gigsData }) {
const totalEventsData = formatJson(gigsData)
return totalEventsData
}
function formatJson(gigsData) {
let data = {}
data.items = []
for (const yearlyEntries of gigsData.bucketsByYear) {
for (const yearlyItem of yearlyEntries.items) {
data.items.push(yearlyItem.attributes)
}
}
data.stats = gigsData.stats
return data
}