UNPKG

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