fix lint no-prototype-builtins

This commit is contained in:
Johann150 2022-07-04 16:39:04 +02:00
parent a5c3fcea6e
commit d748ba2c51
No known key found for this signature in database
GPG key ID: 9EE6577A2A06F8F1
4 changed files with 6 additions and 5 deletions

View file

@ -98,7 +98,7 @@ export function groupOn<T, S>(f: (x: T) => S, xs: T[]): T[][] {
export function groupByX<T>(collections: T[], keySelector: (x: T) => string) {
return collections.reduce((obj: Record<string, T[]>, item: T) => {
const key = keySelector(item);
if (!obj.hasOwnProperty(key)) {
if (typeof obj[key] === 'undefined') {
obj[key] = [];
}