MCPcopy
hub / github.com/vercel/hyper / getCommandKeys

Function getCommandKeys

app/ui/contextmenu.ts:8–13  ·  view source on GitHub ↗
(keymaps: Record<string, string[]>)

Source from the content-addressed store, hash-verified

6const separator: MenuItemConstructorOptions = {type: 'separator'};
7
8const getCommandKeys = (keymaps: Record<string, string[]>): Record<string, string> =>
9 Object.keys(keymaps).reduce((commandKeys: Record<string, string>, command) => {
10 return Object.assign(commandKeys, {
11 [command]: keymaps[command][0]
12 });
13 }, {});
14
15// only display cut/copy when there's a cursor selection
16const filterCutCopy = (selection: string, menuItem: MenuItemConstructorOptions) => {

Callers 1

contextmenu.tsFile · 0.85

Calls 1

reduceMethod · 0.80

Tested by

no test coverage detected