diff options
| author | Johann150 <johann.galle@protonmail.com> | 2022-07-04 16:39:04 +0200 |
|---|---|---|
| committer | Johann150 <johann.galle@protonmail.com> | 2022-07-04 16:39:04 +0200 |
| commit | d748ba2c51211d3a2833fd1cb6ef898bc149d486 (patch) | |
| tree | c36fae05f983c74b7156317190ccab821d074f7d /packages/client/src/scripts/array.ts | |
| parent | fix lint no-undef (diff) | |
| download | sharkey-d748ba2c51211d3a2833fd1cb6ef898bc149d486.tar.gz sharkey-d748ba2c51211d3a2833fd1cb6ef898bc149d486.tar.bz2 sharkey-d748ba2c51211d3a2833fd1cb6ef898bc149d486.zip | |
fix lint no-prototype-builtins
Diffstat (limited to 'packages/client/src/scripts/array.ts')
| -rw-r--r-- | packages/client/src/scripts/array.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/client/src/scripts/array.ts b/packages/client/src/scripts/array.ts index 29d027de14..26c6195d66 100644 --- a/packages/client/src/scripts/array.ts +++ b/packages/client/src/scripts/array.ts @@ -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] = []; } |