removed polyfills

This commit is contained in:
Matteo Manzinello 2020-07-15 12:17:18 +02:00
parent 9c8f9283b3
commit ebf9859eeb
3 changed files with 0 additions and 49 deletions

View File

@ -1,6 +1,5 @@
// webpack > dist/mailgo.min.js // webpack > dist/mailgo.min.js
import mailgoPolyfill from "./polyfill";
import mailgo from "../src/mailgo"; import mailgo from "../src/mailgo";
// call init mailgo attached to the event DOMContentLoaded // call init mailgo attached to the event DOMContentLoaded
@ -9,6 +8,4 @@ const mailgoConfig = {
dark: true, dark: true,
}; };
mailgoPolyfill();
mailgo(mailgoConfig); mailgo(mailgoConfig);

View File

@ -1,6 +1,5 @@
// webpack > dist/mailgo.min.js // webpack > dist/mailgo.min.js
import mailgoPolyfill from "./polyfill";
import mailgo from "../src/mailgo"; import mailgo from "../src/mailgo";
// call init mailgo attached to the event DOMContentLoaded // call init mailgo attached to the event DOMContentLoaded
@ -8,6 +7,4 @@ const mailgoConfig = {
initEvent: "DOMContentLoaded", initEvent: "DOMContentLoaded",
}; };
mailgoPolyfill();
mailgo(mailgoConfig); mailgo(mailgoConfig);

View File

@ -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;
};
}
};