inherits.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. exports.__esModule = true;
  3. var _setPrototypeOf = require("../core-js/object/set-prototype-of");
  4. var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
  5. var _create = require("../core-js/object/create");
  6. var _create2 = _interopRequireDefault(_create);
  7. var _typeof2 = require("../helpers/typeof");
  8. var _typeof3 = _interopRequireDefault(_typeof2);
  9. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10. exports.default = function (subClass, superClass) {
  11. if (typeof superClass !== "function" && superClass !== null) {
  12. throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
  13. }
  14. subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
  15. constructor: {
  16. value: subClass,
  17. enumerable: false,
  18. writable: true,
  19. configurable: true
  20. }
  21. });
  22. if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
  23. };