interopRequireWildcard.js 1.0 KB

123456789101112131415161718192021222324252627
  1. var _typeof = require("./typeof.js")["default"];
  2. function _getRequireWildcardCache(e) {
  3. if ("function" != typeof WeakMap) return null;
  4. var r = new WeakMap(),
  5. t = new WeakMap();
  6. return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
  7. return e ? t : r;
  8. })(e);
  9. }
  10. function _interopRequireWildcard(e, r) {
  11. if (!r && e && e.__esModule) return e;
  12. if (null === e || "object" != _typeof(e) && "function" != typeof e) return {
  13. "default": e
  14. };
  15. var t = _getRequireWildcardCache(r);
  16. if (t && t.has(e)) return t.get(e);
  17. var n = {
  18. __proto__: null
  19. },
  20. a = Object.defineProperty && Object.getOwnPropertyDescriptor;
  21. for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
  22. var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
  23. i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
  24. }
  25. return n["default"] = e, t && t.set(e, n), n;
  26. }
  27. module.exports = _interopRequireWildcard, module.exports.__esModule = true, module.exports["default"] = module.exports;