1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-03 21:00:04 +02:00

update some packages and remove node_modules from repo

This commit is contained in:
s2
2019-03-09 16:38:04 +01:00
parent 3dcadb39c2
commit d24a82e91e
94766 changed files with 290 additions and 858252 deletions

View File

@@ -1,21 +0,0 @@
"use strict";
const modifiers = /^(Command|Cmd|Control|Ctrl|CommandOrControl|CmdOrCtrl|Alt|Option|AltGr|Shift|Super)$/;
const keyCodes = /^([0-9A-Z)!@#$%^&*(:+<_>?~{|}";=,\-./`[\\\]']|F1*[1-9]|F10|F2[0-4]|Plus|Space|Tab|Backspace|Delete|Insert|Return|Enter|Up|Down|Left|Right|Home|End|PageUp|PageDown|Escape|Esc|VolumeUp|VolumeDown|VolumeMute|MediaNextTrack|MediaPreviousTrack|MediaStop|MediaPlayPause|PrintScreen)$/;
module.exports = function (str) {
let parts = str.split("+");
let keyFound = false;
return parts.every((val, index) => {
const isKey = keyCodes.test(val);
const isModifier = modifiers.test(val);
if (isKey) {
// Key must be unique
if (keyFound) return false;
keyFound = true;
}
// Key is required
if (index === parts.length - 1 && !keyFound) return false;
return isKey || isModifier;
});
};