From 323e51ece6c23cb41ac789db9e681cc701bb4f2e Mon Sep 17 00:00:00 2001 From: Flummi Date: Tue, 13 Nov 2018 07:53:15 +0100 Subject: [PATCH] bugfix --- src/clients/discord.mjs | 18 ------------------ src/clients/irc.mjs | 18 ------------------ src/clients/irc/whois.mjs | 18 ------------------ src/clients/tg.mjs | 18 ------------------ src/inc/wrapper.mjs | 23 +++++++++++++++++++++++ 5 files changed, 23 insertions(+), 72 deletions(-) diff --git a/src/clients/discord.mjs b/src/clients/discord.mjs index 9635403..35a4f3b 100644 --- a/src/clients/discord.mjs +++ b/src/clients/discord.mjs @@ -92,21 +92,3 @@ export class discord extends EventEmitter { ; } }; - -Map.prototype.hasi = function(val) { - for (let [key] of this) - if(key.toLowerCase() === val.toLowerCase()) - return true; - return false; -}; -Map.prototype.geti = function(val) { - for (let [key, value] of this) - if(key.toLowerCase() === val.toLowerCase()) - return value; - return false; -}; -Map.prototype.deli = function(val) { - for (let [key] of this) - if(key.toLowerCase() === val.toLowerCase()) - this.delete(key); -}; \ No newline at end of file diff --git a/src/clients/irc.mjs b/src/clients/irc.mjs index 321cb9b..3efc52c 100644 --- a/src/clients/irc.mjs +++ b/src/clients/irc.mjs @@ -175,21 +175,3 @@ export class irc extends EventEmitter { ; } } - -/*Map.prototype.hasi = function(val) { - for (let [key] of this) - if(key.toLowerCase() === val.toLowerCase()) - return true; - return false; -}; -Map.prototype.geti = function(val) { - for (let [key, value] of this) - if(key.toLowerCase() === val.toLowerCase()) - return value; - return false; -}; -Map.prototype.deli = function(val) { - for (let [key] of this) - if(key.toLowerCase() === val.toLowerCase()) - this.delete(key); -};*/ \ No newline at end of file diff --git a/src/clients/irc/whois.mjs b/src/clients/irc/whois.mjs index 082c7ae..5008b88 100644 --- a/src/clients/irc/whois.mjs +++ b/src/clients/irc/whois.mjs @@ -75,21 +75,3 @@ export default client => { this.server.user.set(msg.params[1], tmpuser); }.bind(client)); }; - -Map.prototype.hasi = function (val) { - for (let [key] of this) - if (key.toLowerCase() === val.toLowerCase()) - return true; - return false; -}; -Map.prototype.geti = function (val) { - for (let [key, value] of this) - if (key.toLowerCase() === val.toLowerCase()) - return value; - return false; -}; -Map.prototype.deli = function (val) { - for (let [key] of this) - if (key.toLowerCase() === val.toLowerCase()) - this.delete(key); -}; \ No newline at end of file diff --git a/src/clients/tg.mjs b/src/clients/tg.mjs index fc73bef..dd2e7a7 100644 --- a/src/clients/tg.mjs +++ b/src/clients/tg.mjs @@ -151,21 +151,3 @@ export class tg extends EventEmitter { ; } } - -Map.prototype.hasi = function(val) { - for (let [key] of this) - if(key.toLowerCase() === val.toLowerCase()) - return true; - return false; -}; -Map.prototype.geti = function(val) { - for (let [key, value] of this) - if(key.toLowerCase() === val.toLowerCase()) - return value; - return false; -}; -Map.prototype.deli = function(val) { - for (let [key] of this) - if(key.toLowerCase() === val.toLowerCase()) - this.delete(key); -}; \ No newline at end of file diff --git a/src/inc/wrapper.mjs b/src/inc/wrapper.mjs index aaaaea9..a1a1f8f 100644 --- a/src/inc/wrapper.mjs +++ b/src/inc/wrapper.mjs @@ -47,3 +47,26 @@ const wrapper = class wrapper extends EventEmitter { }; export { wrapper, clients }; + +Map.prototype.hasi = function(val) { + try { + for (let [key] of this) + if(key.toLowerCase() === val.toLowerCase()) + return true; + return false; + } catch(err) { + console.log("das übliche mit tolowercase()"); + return false; + } +}; +Map.prototype.geti = function(val) { + for (let [key, value] of this) + if(key.toLowerCase() === val.toLowerCase()) + return value; + return false; +}; +Map.prototype.deli = function(val) { + for (let [key] of this) + if(key.toLowerCase() === val.toLowerCase()) + this.delete(key); +};