Skip to content

Commit

Permalink
refactor(ingame options): use a for loop to parse builtInPages
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyFuller committed Oct 31, 2024
1 parent 1e42371 commit 6112b69
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions components/menus/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@ const commandMap = new Map<string, CommandFunction>([

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const builtInPages: Record<string, any> = {
"/pages/peacock-menu/index.json": JSON.parse(PeacockMenuIndex),
"/pages/peacock-menu/options.json": JSON.parse(PeacockMenuOptions),
"/pages/peacock-menu/flags/index.json": JSON.parse(PeacockMenuFlagIndex),
"/pages/peacock-menu/flags/category.json": JSON.parse(
PeacockMenuFlagCategory,
),
"/pages/peacock-menu/flags/flag.json": JSON.parse(PeacockMenuFlag),
"/pages/peacock-menu/index.json": PeacockMenuIndex,
"/pages/peacock-menu/options.json": PeacockMenuOptions,
"/pages/peacock-menu/flags/index.json": PeacockMenuFlagIndex,
"/pages/peacock-menu/flags/category.json": PeacockMenuFlagCategory,
"/pages/peacock-menu/flags/flag.json": PeacockMenuFlag,
}

Object.keys(builtInPages).forEach((page) => {
// Parse the string into an object
builtInPages[page] = JSON.parse(builtInPages[page])
})

const pagePrefix = "/pages/peacock-menu/"
const jsonExtension = ".json"

Expand Down

0 comments on commit 6112b69

Please sign in to comment.