1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Files
docs/script/graphql/utils/process-upcoming-changes.js
Kevin Heis 8a56437c93 Pretty format (#20352)
* Update prettier flow to include JS

* Run prettier

* ...run prettier
2021-07-14 14:35:01 -07:00

17 lines
562 B
JavaScript

#!/usr/bin/env node
import yaml from 'js-yaml'
import { groupBy } from 'lodash-es'
import renderContent from '../../../lib/render-content/index.js'
export default async function processUpcomingChanges(upcomingChangesYml) {
const upcomingChanges = yaml.load(upcomingChangesYml).upcoming_changes
for (const change of upcomingChanges) {
change.date = change.date.slice(0, 10)
change.reason = await renderContent(change.reason)
change.description = await renderContent(change.description)
}
return groupBy(upcomingChanges.reverse(), 'date')
}