inherits.js 566 B

12345678910111213141516
  1. import _Object$create from "@babel/runtime-corejs3/core-js/object/create";
  2. import setPrototypeOf from "./setPrototypeOf.js";
  3. export default function _inherits(subClass, superClass) {
  4. if (typeof superClass !== "function" && superClass !== null) {
  5. throw new TypeError("Super expression must either be null or a function");
  6. }
  7. subClass.prototype = _Object$create(superClass && superClass.prototype, {
  8. constructor: {
  9. value: subClass,
  10. writable: true,
  11. configurable: true
  12. }
  13. });
  14. if (superClass) setPrototypeOf(subClass, superClass);
  15. }