We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b42d11 commit 7b09c1eCopy full SHA for 7b09c1e
core/src/util.ts
@@ -187,11 +187,15 @@ function unimplemented(): never {
187
throw new Error('not implemented')
188
}
189
190
-function splitArray<T>(arr: T[], chunkSize: number): T[][] {
+function splitArray<T>(arr: T[], chunkSize: number, fill: boolean = true): (T|null)[][] {
191
const res = []
192
193
for (let i = 0; i < arr.length; i += chunkSize) {
194
- res.push(arr.slice(i, i + chunkSize))
+ const slice: (T | null)[] = arr.slice(i, i + chunkSize)
195
+ while (fill && slice.length < chunkSize) {
196
+ slice.push(null);
197
+ }
198
+ res.push(slice)
199
200
201
return res
0 commit comments