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,39 +0,0 @@
'use strict';
function _lower(key) {
if (typeof key !== 'string') {
return key;
}
return key.toLowerCase();
}
function areEqual(ev1, ev2) {
if (ev1 === ev2) {
// Same object
// console.log(`Events are same.`)
return true;
}
for (const prop of ['altKey', 'ctrlKey', 'shiftKey', 'metaKey']) {
const [value1, value2] = [ev1[prop], ev2[prop]];
if (Boolean(value1) !== Boolean(value2)) {
// One of the prop is different
// console.log(`Comparing prop ${prop}: ${value1} ${value2}`);
return false;
}
}
if ((_lower(ev1.key) === _lower(ev2.key) && ev1.key !== undefined) ||
(ev1.code === ev2.code && ev1.code !== undefined)) {
// Events are equals
return true;
}
// Key or code are differents
// console.log(`key or code are differents. ${ev1.key} !== ${ev2.key} ${ev1.code} !== ${ev2.code}`);
return false;
}
module.exports = areEqual;