UNPKG

595 BJavaScriptView Raw
1"use strict";
2
3(() => {
4 if (typeof window !== 'object' || typeof window.CustomEvent === 'function') return;
5 const CustomEvent = (event, params) => {
6 params = params || {
7 bubbles: false,
8 cancelable: false,
9 detail: null
10 };
11 let evt = document.createEvent('CustomEvent');
12 evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
13 return evt;
14 };
15 window.CustomEvent = CustomEvent;
16})();
17(() => {
18 if (typeof Object.values === 'function') return;
19 const values = O => Object.keys(O).map(key => O[key]);
20 Object.values = values;
21})();
\No newline at end of file