index.js 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. module.exports = (function() {
  2. var __MODS__ = {};
  3. var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
  4. var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
  5. var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
  6. var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
  7. __DEFINE__(1682324647477, function(require, module, exports) {
  8. var wrappy = require('wrappy')
  9. var reqs = Object.create(null)
  10. var once = require('once')
  11. module.exports = wrappy(inflight)
  12. function inflight (key, cb) {
  13. if (reqs[key]) {
  14. reqs[key].push(cb)
  15. return null
  16. } else {
  17. reqs[key] = [cb]
  18. return makeres(key)
  19. }
  20. }
  21. function makeres (key) {
  22. return once(function RES () {
  23. var cbs = reqs[key]
  24. var len = cbs.length
  25. var args = slice(arguments)
  26. // XXX It's somewhat ambiguous whether a new callback added in this
  27. // pass should be queued for later execution if something in the
  28. // list of callbacks throws, or if it should just be discarded.
  29. // However, it's such an edge case that it hardly matters, and either
  30. // choice is likely as surprising as the other.
  31. // As it happens, we do go ahead and schedule it for later execution.
  32. try {
  33. for (var i = 0; i < len; i++) {
  34. cbs[i].apply(null, args)
  35. }
  36. } finally {
  37. if (cbs.length > len) {
  38. // added more in the interim.
  39. // de-zalgo, just in case, but don't call again.
  40. cbs.splice(0, len)
  41. process.nextTick(function () {
  42. RES.apply(null, args)
  43. })
  44. } else {
  45. delete reqs[key]
  46. }
  47. }
  48. })
  49. }
  50. function slice (args) {
  51. var length = args.length
  52. var array = []
  53. for (var i = 0; i < length; i++) array[i] = args[i]
  54. return array
  55. }
  56. }, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
  57. return __REQUIRE__(1682324647477);
  58. })()
  59. //miniprogram-npm-outsideDeps=["wrappy","once"]
  60. //# sourceMappingURL=index.js.map