Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. var babelHelpers = {};
  2.  
  3. babelHelpers.typeof =
  4. typeof Symbol === "function" && typeof Symbol.iterator === "symbol"
  5. ? function (obj) {
  6. return typeof obj;
  7. }
  8. : function (obj) {
  9. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype
  10. ? "symbol"
  11. : typeof obj;
  12. };
  13.  
  14. babelHelpers.classCallCheck = function (instance, Constructor) {
  15. if (!(instance instanceof Constructor)) {
  16. throw new TypeError("Cannot call a class as a function");
  17. }
  18. };
  19.  
  20. babelHelpers.extends =
  21. Object.assign ||
  22. function (target) {
  23. for (var i = 1; i < arguments.length; i++) {
  24. var source = arguments[i];
  25.  
  26. for (var key in source) {
  27. if (Object.prototype.hasOwnProperty.call(source, key)) {
  28. target[key] = source[key];
  29. }
  30. }
  31. }
  32.  
  33. return target;
  34. };
  35.  
  36. babelHelpers.inherits = function (subClass, superClass) {
  37. if (typeof superClass !== "function" && superClass !== null) {
  38. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  39. }
  40.  
  41. subClass.prototype = Object.create(superClass && superClass.prototype, {
  42. constructor: {
  43. value: subClass,
  44. enumerable: false,
  45. writable: true,
  46. configurable: true
  47. }
  48. });
  49. if (superClass)
  50. Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : (subClass.__proto__ = superClass);
  51. };
  52.  
  53. babelHelpers.possibleConstructorReturn = function (self, call) {
  54. if (!self) {
  55. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  56. }
  57.  
  58. return call && (typeof call === "object" || typeof call === "function") ? call : self;
  59. };
  60.  
  61. babelHelpers.createClass = (function() {
  62. function defineProperties(target, props) {
  63. for (var i = 0; i < props.length; i++) {
  64. var descriptor = props[i];
  65. descriptor.enumerable = descriptor.enumerable || false;
  66. descriptor.configurable = true;
  67. if ("value" in descriptor) descriptor.writable = true;
  68. Object.defineProperty(target, descriptor.key, descriptor);
  69. }
  70. }
  71.  
  72. return function(Constructor, protoProps, staticProps) {
  73. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  74. if (staticProps) defineProperties(Constructor, staticProps);
  75. return Constructor;
  76. };
  77. })();
  78.  
  79. window.babelHelpers = babelHelpers;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement