MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / parseKeyParts

Function parseKeyParts

src/lib/keyBindings.js:699–717  ·  view source on GitHub ↗
(combo)

Source from the content-addressed store, hash-verified

697}
698
699function parseKeyParts(combo) {
700 const modifiers = new Set();
701 let baseKey = "";
702 if (!combo) return { modifiers, baseKey };
703 const parts = combo.endsWith("-")
704 ? [...combo.slice(0, -1).split("-").filter(Boolean), "-"]
705 : combo.split("-");
706 for (const rawPart of parts) {
707 const part = rawPart.trim();
708 if (!part) continue;
709 const normalized = part.charAt(0).toUpperCase() + part.slice(1);
710 if (MODIFIER_ORDER.includes(normalized)) {
711 modifiers.add(normalized);
712 } else {
713 baseKey = part;
714 }
715 }
716 return { modifiers, baseKey };
717}
718
719function humanizeCommandName(name) {
720 return name

Callers 2

normalizeKeyFunction · 0.85
ensureModifierFunction · 0.85

Calls 1

addMethod · 0.80

Tested by

no test coverage detected