Finished bw stats table

This commit is contained in:
2025-08-21 23:26:17 +02:00
parent b222fb1f60
commit b9959e86b7
4 changed files with 248 additions and 20 deletions

17
src/lib/funcs.ts Normal file
View File

@@ -0,0 +1,17 @@
export function concatStatArrays(...arrays: number[][]) {
if (arrays.length === 0) return []
const indexes = [2, 5, 8]
const result = arrays[0].map((v, index) => {
if (v < 0) return "?"
if (indexes.includes(index) || index === arrays[0].length - 1) {
return arrays.reduce((sum, array) => sum + array[index], 0) / arrays.length
}
return arrays.reduce((sum, array) => sum + array[index], 0)
})
return result
}