MCPcopy
hub / github.com/philc/vimium / validateParsedKey

Function validateParsedKey

background_scripts/commands.js:75–82  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

73
74 const validModifiers = ["a", "c", "m", "s"];
75 const validateParsedKey = function (key) {
76 if (!key?.match(modifiedKey)) return;
77 // Check that the modifier is valid and not capitalized.
78 const mod = key.split("-")[0].slice(1);
79 if (!validModifiers.includes(mod)) {
80 return `${key} has an invalid modifier; valid modifiers are ${validModifiers}`;
81 }
82 };
83 const validateUrl = function (str) {
84 try {
85 new URL(str);

Callers 1

parseFunction · 0.85

Calls 1

matchMethod · 0.80

Tested by

no test coverage detected