From ebf9859eeb71e16041c50dc60f6742a6b3dd92b5 Mon Sep 17 00:00:00 2001 From: Matteo Manzinello Date: Wed, 15 Jul 2020 12:17:18 +0200 Subject: [PATCH] removed polyfills --- webpack/mailgo.dist.dark.ts | 3 --- webpack/mailgo.dist.ts | 3 --- webpack/polyfill.js | 43 ------------------------------------- 3 files changed, 49 deletions(-) delete mode 100644 webpack/polyfill.js diff --git a/webpack/mailgo.dist.dark.ts b/webpack/mailgo.dist.dark.ts index 573a61e..ba7ea18 100644 --- a/webpack/mailgo.dist.dark.ts +++ b/webpack/mailgo.dist.dark.ts @@ -1,6 +1,5 @@ // webpack > dist/mailgo.min.js -import mailgoPolyfill from "./polyfill"; import mailgo from "../src/mailgo"; // call init mailgo attached to the event DOMContentLoaded @@ -9,6 +8,4 @@ const mailgoConfig = { dark: true, }; -mailgoPolyfill(); - mailgo(mailgoConfig); diff --git a/webpack/mailgo.dist.ts b/webpack/mailgo.dist.ts index 679b2dc..46d6b0d 100644 --- a/webpack/mailgo.dist.ts +++ b/webpack/mailgo.dist.ts @@ -1,6 +1,5 @@ // webpack > dist/mailgo.min.js -import mailgoPolyfill from "./polyfill"; import mailgo from "../src/mailgo"; // call init mailgo attached to the event DOMContentLoaded @@ -8,6 +7,4 @@ const mailgoConfig = { initEvent: "DOMContentLoaded", }; -mailgoPolyfill(); - mailgo(mailgoConfig); diff --git a/webpack/polyfill.js b/webpack/polyfill.js deleted file mode 100644 index 981c89a..0000000 --- a/webpack/polyfill.js +++ /dev/null @@ -1,43 +0,0 @@ -// polyfill for mailgo - -export default mailgoPolyfill = () => { - if (!Array.prototype.includes) { - Array.prototype.includes = function (searchElement /*, fromIndex*/) { - "use strict"; - if (this == null) { - throw new TypeError( - "Array.prototype.includes called on null or undefined" - ); - } - - var O = Object(this); - var len = parseInt(O.length, 10) || 0; - if (len === 0) { - return false; - } - var n = parseInt(arguments[1], 10) || 0; - var k; - if (n >= 0) { - k = n; - } else { - k = len + n; - if (k < 0) { - k = 0; - } - } - var currentElement; - while (k < len) { - currentElement = O[k]; - if ( - searchElement === currentElement || - (searchElement !== searchElement && currentElement !== currentElement) - ) { - // NaN !== NaN - return true; - } - k++; - } - return false; - }; - } -};