refactor(talks): use flatMap and size methods

This commit is contained in:
Oliver Davies 2022-10-16 00:57:45 +01:00
parent 217e98b7e3
commit ee4f48abcd

View file

@ -5,10 +5,8 @@ import PageLayout from '../../layouts/PageLayout.astro'
const talks = await Astro.glob("../../talks/*.md")
const talkCount = _(talks)
.map((talk) => talk.frontmatter.events)
.flatten()
.value()
.length
.flatMap((talk) => talk.frontmatter.events)
.size()
const sortedTalks = talks
.map(talk => {