frontend: lint and format
This commit is contained in:
@@ -38,19 +38,17 @@ export function trimLateGameItems(builds: Builds): void {
|
||||
collectItemIds(builds.tree)
|
||||
|
||||
// Remove late game items that appear in core
|
||||
builds.lateGame = builds.lateGame.filter((item) => !coreItemIds.has(item.data))
|
||||
builds.lateGame = builds.lateGame.filter(item => !coreItemIds.has(item.data))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the index of the build with the highest pickrate
|
||||
*/
|
||||
export function getHighestPickrateBuildIndex(
|
||||
runes: Array<{ pickrate: number }>
|
||||
): number {
|
||||
export function getHighestPickrateBuildIndex(runes: Array<{ pickrate: number }>): number {
|
||||
if (runes.length === 0) return 0
|
||||
|
||||
return runes.reduce((maxIdx, rune, idx, arr) =>
|
||||
rune.pickrate > arr[maxIdx].pickrate ? idx : maxIdx,
|
||||
return runes.reduce(
|
||||
(maxIdx, rune, idx, arr) => (rune.pickrate > arr[maxIdx].pickrate ? idx : maxIdx),
|
||||
0
|
||||
)
|
||||
}
|
||||
@@ -58,12 +56,9 @@ export function getHighestPickrateBuildIndex(
|
||||
/**
|
||||
* Gets the first core item for each build variant
|
||||
*/
|
||||
export function getFirstCoreItems(
|
||||
runes: unknown[],
|
||||
builds: Builds
|
||||
): number[] {
|
||||
export function getFirstCoreItems(runes: unknown[], builds: Builds): number[] {
|
||||
return runes.map(() => {
|
||||
const tree = builds?.tree
|
||||
return tree?.children?.[0]?.data ?? tree?.data ?? 0
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,3 @@ export const MOCK_SUMMONER_SPELLS = [
|
||||
{ id: 14, count: 600, pickrate: 0.15 }, // Ignite
|
||||
{ id: 3, count: 200, pickrate: 0.05 } // Exhaust
|
||||
]
|
||||
|
||||
/**
|
||||
* Constants used throughout the application
|
||||
*/
|
||||
export const BOOTS_RUSH_THRESHOLD = 0.5
|
||||
Reference in New Issue
Block a user