File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ type ArboristClass = typeof BaseArborist & {
38
38
new ( ...args : any ) : typeof BaseArborist
39
39
}
40
40
41
+ type AwaitedYield < T > = T extends AsyncGenerator < infer Y , any , any > ? Y : never
42
+
41
43
type EdgeClass = Omit < BaseEdge , 'overrides' | 'reload' > & {
42
44
optional : boolean
43
45
overrides : OverrideSetClass | undefined
@@ -434,16 +436,17 @@ async function packagesHaveRiskyIssues(
434
436
p => p . pkgid === id && p . existing ?. startsWith ( `${ name } @` )
435
437
)
436
438
if ( pkg ?. existing ) {
437
- // eslint-disable-next-line no-await-in-loop
438
- for await ( const oldPkgData of batchScan ( [ pkg . existing ] ) ) {
439
- if ( oldPkgData . type === 'success' ) {
440
- failures = failures . filter (
441
- issue =>
442
- oldPkgData . value . issues . find (
443
- oldIssue => oldIssue . type === issue . type
444
- ) === undefined
445
- )
446
- }
439
+ const oldPkgData = < AwaitedYield < ReturnType < typeof batchScan > > > (
440
+ // eslint-disable-next-line no-await-in-loop
441
+ ( await batchScan ( [ pkg . existing ] ) . next ( ) ) . value
442
+ )
443
+ if ( oldPkgData . type === 'success' ) {
444
+ failures = failures . filter (
445
+ issue =>
446
+ oldPkgData . value . issues . find (
447
+ oldIssue => oldIssue . type === issue . type
448
+ ) === undefined
449
+ )
447
450
}
448
451
}
449
452
}
You can’t perform that action at this time.
0 commit comments