@@ -12,8 +12,8 @@ import {
12
12
import { confirm } from '@socketsecurity/registry/lib/prompts'
13
13
import { Spinner } from '@socketsecurity/registry/lib/spinner'
14
14
15
- import { kCtorArgs , kRiskyReify } from './index'
16
15
import { getPackagesToQueryFromDiff } from './diff'
16
+ import { kCtorArgs , kRiskyReify } from './index'
17
17
import constants from '../../../../constants'
18
18
import {
19
19
batchScan ,
@@ -27,8 +27,8 @@ import { getSocketDevPackageOverviewUrl } from '../../../../utils/socket-url'
27
27
import { pacotePath } from '../../../npm-paths'
28
28
import { Edge , SafeEdge } from '../edge'
29
29
30
+ import type { PackageDetail } from './diff'
30
31
import type { ArboristClass , AuditAdvisory , SafeArborist } from './index'
31
- import type { InstallEffect } from './walk'
32
32
import type { SocketArtifact } from '../../../../utils/alert/artifact'
33
33
import type { SafeNode } from '../node'
34
34
import type { Writable } from 'node:stream'
@@ -107,10 +107,10 @@ type GetPackageAlertsOptions = {
107
107
108
108
async function getPackagesAlerts (
109
109
safeArb : SafeArborist ,
110
- pkgs : InstallEffect [ ] ,
110
+ details : PackageDetail [ ] ,
111
111
options ?: GetPackageAlertsOptions
112
112
) : Promise < SocketPackageAlert [ ] > {
113
- let { length : remaining } = pkgs
113
+ let { length : remaining } = details
114
114
const packageAlerts : SocketPackageAlert [ ] = [ ]
115
115
if ( ! remaining ) {
116
116
return packageAlerts
@@ -125,7 +125,7 @@ async function getPackagesAlerts(
125
125
: ( ) => ''
126
126
spinner ?. start ( getText ( ) )
127
127
try {
128
- for await ( const artifact of batchScan ( pkgs . map ( p => p . pkgid ) ) ) {
128
+ for await ( const artifact of batchScan ( details . map ( d => d . pkgid ) ) ) {
129
129
if ( ! artifact . name || ! artifact . version || ! artifact . alerts ?. length ) {
130
130
continue
131
131
}
@@ -371,10 +371,7 @@ export async function reify(
371
371
...args : Parameters < InstanceType < ArboristClass > [ 'reify' ] >
372
372
) : Promise < SafeNode > {
373
373
const needInfoOn = getPackagesToQueryFromDiff ( this . diff )
374
- if (
375
- ! needInfoOn . length ||
376
- needInfoOn . findIndex ( c => c . repository_url === NPM_REGISTRY_URL ) === - 1
377
- ) {
374
+ if ( ! needInfoOn . length ) {
378
375
// Nothing to check, hmmm already installed or all private?
379
376
return await this [ kRiskyReify ] ( ...args )
380
377
}
0 commit comments