File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1- declare function isWeakRef < T extends object > ( value : unknown ) : value is WeakRef < T > ;
1+ declare function isWeakRef < T extends WeakKey > ( value : unknown ) : value is WeakRef < T > ;
22
33export = isWeakRef ;
Original file line number Diff line number Diff line change 22
33var callBound = require ( 'call-bound' ) ;
44
5- var $deref = callBound ( 'WeakRef.prototype.deref' , true ) ;
5+ // eslint-disable-next-line no-extra-parens
6+ var $deref = /** @type {<T extends WeakKey>(thisArg: WeakRef<T>) => T | undefined } */ ( callBound ( 'WeakRef.prototype.deref' , true ) ) ;
67
78/** @type {import('.') } */
89module . exports = typeof WeakRef === 'undefined'
@@ -14,6 +15,7 @@ module.exports = typeof WeakRef === 'undefined'
1415 return false ;
1516 }
1617 try {
18+ // @ts -expect-error
1719 $deref ( value ) ;
1820 return true ;
1921 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments