* Improve typescript null checking in places * Iterate * Fix Timer.ts
This commit is contained in:
parent
97506cbcdb
commit
9743852380
43 changed files with 155 additions and 154 deletions
|
@ -266,7 +266,7 @@ export class ArrayUtil<T> {
|
|||
const obj = this.a.reduce((rv: Map<K, T[]>, val: T) => {
|
||||
const k = fn(val);
|
||||
if (!rv.has(k)) rv.set(k, []);
|
||||
rv.get(k).push(val);
|
||||
rv.get(k)!.push(val);
|
||||
return rv;
|
||||
}, new Map<K, T[]>());
|
||||
return new GroupedArray(obj);
|
||||
|
@ -299,7 +299,7 @@ export class GroupedArray<K, T> {
|
|||
const a: T[] = [];
|
||||
for (const k of keyOrder) {
|
||||
if (!this.val.has(k)) continue;
|
||||
a.push(...this.val.get(k));
|
||||
a.push(...this.val.get(k)!);
|
||||
}
|
||||
return new ArrayUtil(a);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue