MCPcopy Index your code
hub / github.com/massCodeIO/massCode / createPlatformMenuItems

Function createPlatformMenuItems

src/main/menu/utils/index.ts:11–23  ·  view source on GitHub ↗
(
  items: MenuConfig[],
  currentPlatform: Platform = process.platform as Platform,
)

Source from the content-addressed store, hash-verified

9}
10
11export function createPlatformMenuItems(
12 items: MenuConfig[],
13 currentPlatform: Platform = process.platform as Platform,
14): MenuItemConstructorOptions[] {
15 return items
16 .filter(
17 item => !item.platforms || item.platforms.includes(currentPlatform),
18 )
19 .map((item) => {
20 const { id, platforms, ...menuItem } = item
21 return menuItem as MenuItemConstructorOptions
22 })
23}
24
25export function createMenu(template: MenuItemConstructorOptions[]) {
26 const menu = Menu.buildFromTemplate(template)

Callers 2

createMainMenuTemplateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected