« get me outta code hell

use accumulateSum util where appropriate - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/album-commentary.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-11-26 23:48:16 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-11-26 23:48:16 -0400
commit0ff89848bd7252c3dfc840bc40a0bd6a9d1376bd (patch)
tree45c1379b6631473d10892a29693d7f7829942b69 /src/page/album-commentary.js
parent003f594f6348b55109dd66416e75fcc2a88faade (diff)
use accumulateSum util where appropriate
Diffstat (limited to 'src/page/album-commentary.js')
-rw-r--r--src/page/album-commentary.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/page/album-commentary.js b/src/page/album-commentary.js
index a0ac8d9..50a2aa3 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',