diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-01-11 13:03:10 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-01-11 13:03:10 -0400 |
commit | 867c00a1a9d01745bb9f13b4dc69b750a34293cd (patch) | |
tree | 7c6aba6818792bc972bae8ba321caa37d90dba7c | |
parent | fb94c24043b9f7db8f5e9a9c0c64faaf95cc88ed (diff) |
data: chunkMultipleArrays: fix zero-items case
-rw-r--r-- | src/util/wiki-data.js | 4 |
1 files changed, 4 insertions, 0 deletions
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)]; |