Changeset 79a0317 for imaps-frontend/node_modules/is-weakset/index.js
- Timestamp:
- 01/21/25 03:08:24 (3 days ago)
- Branches:
- main
- Parents:
- 0c6b92a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/is-weakset/index.js
r0c6b92a r79a0317 2 2 3 3 var GetIntrinsic = require('get-intrinsic'); 4 var callBound = require('call-b ind/callBound');4 var callBound = require('call-bound'); 5 5 6 6 var $WeakSet = GetIntrinsic('%WeakSet%', true); 7 7 8 /** @type {undefined | (<V>(thisArg: Set<V>, value: V) => boolean)} */ 8 9 var $setHas = callBound('WeakSet.prototype.has', true); 9 10 10 11 if ($setHas) { 12 /** @type {undefined | (<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean)} */ 11 13 var $mapHas = callBound('WeakMap.prototype.has', true); 12 14 … … 17 19 } 18 20 try { 21 // @ts-expect-error TS can't figure out that $setHas is always truthy here 19 22 $setHas(x, $setHas); 20 23 if ($mapHas) { 21 24 try { 25 // @ts-expect-error this indeed might not be a weak collection 22 26 $mapHas(x, $mapHas); 23 27 } catch (e) { … … 32 36 } else { 33 37 /** @type {import('.')} */ 34 // eslint-disable-next-line no-unused-vars35 module.exports = function isWeakSet(x) { 38 // @ts-expect-error 39 module.exports = function isWeakSet(x) { // eslint-disable-line no-unused-vars 36 40 // `WeakSet` does not exist, or does not have a `has` method 37 41 return false;
Note:
See TracChangeset
for help on using the changeset viewer.