From 867c00a1a9d01745bb9f13b4dc69b750a34293cd Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 11 Jan 2024 13:03:10 -0400 Subject: data: chunkMultipleArrays: fix zero-items case --- src/util/wiki-data.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/util') diff --git a/src/util/wiki-data.js b/src/util/wiki-data.js index b5813c7a..1c1db6c1 100644 --- a/src/util/wiki-data.js +++ b/src/util/wiki-data.js @@ -71,6 +71,10 @@ export function chunkMultipleArrays(...args) { const arrays = args.slice(0, -1); const fn = args.at(-1); + if (arrays[0].length === 0) { + return []; + } + const newChunk = index => arrays.map(array => [array[index]]); const results = [newChunk(0)]; -- cgit 1.3.0-6-gf8a5