decentraland / decentraland/builder

Refactor: Remove toLowerCase from indexById on Bridge

Open
#1,807 0 comments 0 reactions 1 assignee Claimed by @juanmahidalgo View on GitHub
Dominant language
TypeScript
Stars
156
Forks
91
Avg merge
2d 7h
Merged PRs (30d)
31

Description

It shouldn't really change anything and it should allow us to rewrite the indexById as

```ts
static indexById(
list: (T | undefined)[]
): Record {
return this.indexBy(list, 'id')
}

static indexBy, K extends string>(
list: (T | undefined)[],
prop: K
): Record {
return list.reduce((obj, result) => {
if (result) {
const key = result[prop]
obj[key as string] = result
}
return obj
}, {} as Record)
}

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.