MCPcopy Create free account
hub / github.com/codeaashu/claude-code / normalizeStep

Function normalizeStep

src/keybindings/reservedShortcuts.ts:95–127  ·  view source on GitHub ↗
(step: string)

Source from the content-addressed store, hash-verified

93}
94
95function normalizeStep(step: string): string {
96 const parts = step.split('+')
97 const modifiers: string[] = []
98 let mainKey = ''
99
100 for (const part of parts) {
101 const lower = part.trim().toLowerCase()
102 if (
103 [
104 'ctrl',
105 'control',
106 'alt',
107 'opt',
108 'option',
109 'meta',
110 'cmd',
111 'command',
112 'shift',
113 ].includes(lower)
114 ) {
115 // Normalize modifier names
116 if (lower === 'control') modifiers.push('ctrl')
117 else if (lower === 'option' || lower === 'opt') modifiers.push('alt')
118 else if (lower === 'command' || lower === 'cmd') modifiers.push('cmd')
119 else modifiers.push(lower)
120 } else {
121 mainKey = lower
122 }
123 }
124
125 modifiers.sort()
126 return [...modifiers, mainKey].join('+')
127}
128

Callers

nothing calls this directly

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected