File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ type ArboristClass = typeof BaseArborist & {
3838 new ( ...args : any ) : typeof BaseArborist
3939}
4040
41+ type AwaitedYield < T > = T extends AsyncGenerator < infer Y , any , any > ? Y : never
42+
4143type EdgeClass = Omit < BaseEdge , 'overrides' | 'reload' > & {
4244 optional : boolean
4345 overrides : OverrideSetClass | undefined
@@ -434,16 +436,17 @@ async function packagesHaveRiskyIssues(
434436 p => p . pkgid === id && p . existing ?. startsWith ( `${ name } @` )
435437 )
436438 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+ )
447450 }
448451 }
449452 }
You can’t perform that action at this time.
0 commit comments