diff --git a/assets/js/app.js b/assets/js/app.js index 52c231bf..1d340ca8 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -11,6 +11,7 @@ import './vendor/fetch.polyfill'; import './vendor/closest.polyfill'; import './vendor/customevent.polyfill'; import './vendor/es6.polyfill'; +import './vendor/values-entries.polyfill'; // Our code import './ujs'; diff --git a/assets/js/vendor/values-entries.polyfill.js b/assets/js/vendor/values-entries.polyfill.js new file mode 100644 index 00000000..6ff2a000 --- /dev/null +++ b/assets/js/vendor/values-entries.polyfill.js @@ -0,0 +1,13 @@ +// object-values | MIT | github.com/tc39/proposal-object-values-entries + +if (!Object.values) { + Object.values = function values(O) { + return reduce(keys(O), (v, k) => concat(v, typeof k === 'string' && isEnumerable(O, k) ? [O[k]] : []), []); + }; +} + +if (!Object.entries) { + Object.entries = function entries(O) { + return reduce(keys(O), (e, k) => concat(e, typeof k === 'string' && isEnumerable(O, k) ? [[k, O[k]]] : []), []); + }; +}