运维小程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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__(1761531172239, function(require, module, exports) {
  8. var GetIntrinsic = require('get-intrinsic');
  9. var callBound = require('call-bind/callBound');
  10. var inspect = require('object-inspect');
  11. var $TypeError = require('es-errors/type');
  12. var $WeakMap = GetIntrinsic('%WeakMap%', true);
  13. var $Map = GetIntrinsic('%Map%', true);
  14. var $weakMapGet = callBound('WeakMap.prototype.get', true);
  15. var $weakMapSet = callBound('WeakMap.prototype.set', true);
  16. var $weakMapHas = callBound('WeakMap.prototype.has', true);
  17. var $mapGet = callBound('Map.prototype.get', true);
  18. var $mapSet = callBound('Map.prototype.set', true);
  19. var $mapHas = callBound('Map.prototype.has', true);
  20. /*
  21. * This function traverses the list returning the node corresponding to the given key.
  22. *
  23. * That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.
  24. */
  25. /** @type {import('.').listGetNode} */
  26. var listGetNode = function (list, key) { // eslint-disable-line consistent-return
  27. /** @type {typeof list | NonNullable<(typeof list)['next']>} */
  28. var prev = list;
  29. /** @type {(typeof list)['next']} */
  30. var curr;
  31. for (; (curr = prev.next) !== null; prev = curr) {
  32. if (curr.key === key) {
  33. prev.next = curr.next;
  34. // eslint-disable-next-line no-extra-parens
  35. curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
  36. list.next = curr; // eslint-disable-line no-param-reassign
  37. return curr;
  38. }
  39. }
  40. };
  41. /** @type {import('.').listGet} */
  42. var listGet = function (objects, key) {
  43. var node = listGetNode(objects, key);
  44. return node && node.value;
  45. };
  46. /** @type {import('.').listSet} */
  47. var listSet = function (objects, key, value) {
  48. var node = listGetNode(objects, key);
  49. if (node) {
  50. node.value = value;
  51. } else {
  52. // Prepend the new node to the beginning of the list
  53. objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
  54. key: key,
  55. next: objects.next,
  56. value: value
  57. });
  58. }
  59. };
  60. /** @type {import('.').listHas} */
  61. var listHas = function (objects, key) {
  62. return !!listGetNode(objects, key);
  63. };
  64. /** @type {import('.')} */
  65. module.exports = function getSideChannel() {
  66. /** @type {WeakMap<object, unknown>} */ var $wm;
  67. /** @type {Map<object, unknown>} */ var $m;
  68. /** @type {import('.').RootNode<unknown>} */ var $o;
  69. /** @type {import('.').Channel} */
  70. var channel = {
  71. assert: function (key) {
  72. if (!channel.has(key)) {
  73. throw new $TypeError('Side channel does not contain ' + inspect(key));
  74. }
  75. },
  76. get: function (key) { // eslint-disable-line consistent-return
  77. if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
  78. if ($wm) {
  79. return $weakMapGet($wm, key);
  80. }
  81. } else if ($Map) {
  82. if ($m) {
  83. return $mapGet($m, key);
  84. }
  85. } else {
  86. if ($o) { // eslint-disable-line no-lonely-if
  87. return listGet($o, key);
  88. }
  89. }
  90. },
  91. has: function (key) {
  92. if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
  93. if ($wm) {
  94. return $weakMapHas($wm, key);
  95. }
  96. } else if ($Map) {
  97. if ($m) {
  98. return $mapHas($m, key);
  99. }
  100. } else {
  101. if ($o) { // eslint-disable-line no-lonely-if
  102. return listHas($o, key);
  103. }
  104. }
  105. return false;
  106. },
  107. set: function (key, value) {
  108. if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
  109. if (!$wm) {
  110. $wm = new $WeakMap();
  111. }
  112. $weakMapSet($wm, key, value);
  113. } else if ($Map) {
  114. if (!$m) {
  115. $m = new $Map();
  116. }
  117. $mapSet($m, key, value);
  118. } else {
  119. if (!$o) {
  120. // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
  121. $o = { key: {}, next: null };
  122. }
  123. listSet($o, key, value);
  124. }
  125. }
  126. };
  127. return channel;
  128. };
  129. }, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
  130. return __REQUIRE__(1761531172239);
  131. })()
  132. //miniprogram-npm-outsideDeps=["get-intrinsic","call-bind/callBound","object-inspect","es-errors/type"]
  133. //# sourceMappingURL=index.js.map