Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
fix: speed up invert of generated caip info (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnerdhair authored Nov 29, 2021
1 parent 62bad40 commit b7d58e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/caip/src/adapters/coingecko/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const generatedCAIP19ToCoingeckoMap = Object.values(adapters).reduce((acc, cur)
})) as Record<string, string>

const invert = <T extends Record<string, string>>(data: T) =>
Object.entries(data).reduce((acc, [k, v]) => ({ ...acc, [v]: k }), {})
Object.entries(data).reduce((acc, [k, v]) => ((acc[v] = k), acc), {} as Record<string, string>)

const generatedCoingeckoToCAIP19Map: Record<string, string> = invert(generatedCAIP19ToCoingeckoMap)

Expand Down

0 comments on commit b7d58e4

Please sign in to comment.