index.js 907 B

1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. require("core-js/shim");
  3. require("regenerator-runtime/runtime");
  4. require("core-js/fn/regexp/escape");
  5. /* eslint max-len: 0 */
  6. if (global._babelPolyfill) {
  7. throw new Error("only one instance of babel-polyfill is allowed");
  8. }
  9. global._babelPolyfill = true;
  10. // Should be removed in the next major release:
  11. var DEFINE_PROPERTY = "defineProperty";
  12. function define(O, key, value) {
  13. O[key] || Object[DEFINE_PROPERTY](O, key, {
  14. writable: true,
  15. configurable: true,
  16. value: value
  17. });
  18. }
  19. define(String.prototype, "padLeft", "".padStart);
  20. define(String.prototype, "padRight", "".padEnd);
  21. "pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) {
  22. [][key] && define(Array, key, Function.call.bind([][key]));
  23. });