mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 05:41:22 -06:00
Addressed feedback.
This commit is contained in:
parent
d25fd23e04
commit
325f4b84cf
@ -703,7 +703,8 @@ namespace ts {
|
||||
export function sum<T extends Record<K, number>, K extends string>(array: T[], prop: K): number {
|
||||
let result = 0;
|
||||
for (const v of array) {
|
||||
result += (v[prop] as number);
|
||||
// Note: we need the following type assertion because of GH #17069
|
||||
result += v[prop] as number;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user