removed polyfills
This commit is contained in:
parent
9c8f9283b3
commit
ebf9859eeb
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
};
|
||||
}
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user