mirror of
https://github.com/S2-/gitlit
synced 2025-08-03 12:50:04 +02:00
remove node_modules
This commit is contained in:
21
app/node_modules/electron-is-accelerator/index.js
generated
vendored
21
app/node_modules/electron-is-accelerator/index.js
generated
vendored
@@ -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;
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user