Use dep for event polyfill

This commit is contained in:
Josh Johnson 2018-05-25 08:53:50 +01:00
parent 1608d815e9
commit 25309c91fc
2 changed files with 4 additions and 19 deletions

View file

@ -68,10 +68,11 @@
},
"dependencies": {
"classnames": "^2.2.5",
"core-js": "^2.5.6",
"custom-event-polyfill": "^0.3.0",
"fuse.js": "^3.1.0",
"opn": "^5.1.0",
"redux": "^3.3.1",
"core-js": "^2.5.6"
"redux": "^3.3.1"
},
"npmName": "choices.js",
"npmFileMap": [

View file

@ -1,18 +1,2 @@
import 'core-js/fn/array/from';
import 'core-js/fn/array/find';
(function CustomEventPolyfill() {
if (typeof window.CustomEvent === 'function') {
return false;
}
function CustomEvent (event, params = { bubbles: false, cancelable: false, detail: undefined }) {
const evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
}
CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent;
}());
import 'custom-event-polyfill';