From 0ff89848bd7252c3dfc840bc40a0bd6a9d1376bd Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 26 Nov 2022 23:48:16 -0400 Subject: use accumulateSum util where appropriate --- src/page/album-commentary.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/page') diff --git a/src/page/album-commentary.js b/src/page/album-commentary.js index a0ac8d94..50a2aa39 100644 --- a/src/page/album-commentary.js +++ b/src/page/album-commentary.js @@ -1,5 +1,6 @@ // Album commentary page and index specifications. +import {accumulateSum} from '../util/sugar.js'; import {filterAlbumsByCommentary} from '../util/wiki-data.js'; export function condition({wikiData}) { @@ -93,8 +94,8 @@ export function writeTargetless({wikiData}) { words: entries.join(' ').split(' ').length, })); - const totalEntries = data.reduce((acc, {entries}) => acc + entries.length, 0); - const totalWords = data.reduce((acc, {words}) => acc + words, 0); + const totalEntries = accumulateSum(data, ({entries}) => entries.length); + const totalWords = accumulateSum(data, ({words}) => words); const page = { type: 'page', -- cgit 1.3.0-6-gf8a5