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

remove node_modules

This commit is contained in:
s2
2018-05-19 20:19:16 +02:00
parent 460c610361
commit a3f65f089b
1856 changed files with 0 additions and 309697 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;
});
};