Migrate util, types, state, sticker-creator to ESLint
This commit is contained in:
parent
372aa44e49
commit
2ade4acd52
115 changed files with 647 additions and 448 deletions
|
@ -2,10 +2,8 @@ import { fromPairs, map } from 'lodash';
|
|||
|
||||
export function makeLookup<T>(
|
||||
items: Array<T>,
|
||||
key: string
|
||||
key: keyof T
|
||||
): { [key: string]: T } {
|
||||
// Yep, we can't index into item without knowing what it is. True. But we want to.
|
||||
// @ts-ignore
|
||||
const pairs = map(items, item => [item[key], item]);
|
||||
|
||||
return fromPairs(pairs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue