( items: MenuConfig[], currentPlatform: Platform = process.platform as Platform, )
| 9 | } |
| 10 | |
| 11 | export 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 | |
| 25 | export function createMenu(template: MenuItemConstructorOptions[]) { |
| 26 | const menu = Menu.buildFromTemplate(template) |
no outgoing calls
no test coverage detected