From ee4f48abcd38c4a727ac48cd0aa0a5a088b23578 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 16 Oct 2022 00:57:45 +0100 Subject: [PATCH] refactor(talks): use flatMap and size methods --- website/src/pages/talks/index.astro | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/website/src/pages/talks/index.astro b/website/src/pages/talks/index.astro index 1305bb30..7efa616e 100644 --- a/website/src/pages/talks/index.astro +++ b/website/src/pages/talks/index.astro @@ -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 => {