@@ -196,17 +196,17 @@ async function getPackagesAlerts(
196196 const lines = new Set ( )
197197 const translations = getTranslations ( )
198198 for ( const alert of alerts ) {
199- // Based data from { pageProps: { alertTypes } } of:
200- // https://socket.dev/_next/data/94666139314b6437ee4491a0864e72b264547585/en-US.json
201- const info = ( translations . alerts as any ) [ alert . type ]
202- const title = info ?. title ?? alert . type
203199 const attributes = [
204200 ...( alert . fixable ? [ 'fixable' ] : [ ] ) ,
205201 ...( alert . block ? [ ] : [ 'non-blocking' ] )
206202 ]
207203 const maybeAttributes = attributes . length
208204 ? ` (${ attributes . join ( '; ' ) } )`
209205 : ''
206+ // Based data from { pageProps: { alertTypes } } of:
207+ // https://socket.dev/_next/data/94666139314b6437ee4491a0864e72b264547585/en-US.json
208+ const info = ( translations . alerts as any ) [ alert . type ]
209+ const title = info ?. title ?? alert . type
210210 const maybeDesc = info ?. description ? ` - ${ info . description } ` : ''
211211 // TODO: emoji seems to mis-align terminals sometimes
212212 lines . add ( ` ${ title } ${ maybeAttributes } ${ maybeDesc } \n` )
@@ -362,8 +362,11 @@ export async function reify(
362362) : Promise < SafeNode > {
363363 // `this.diff` is `null` when `options.packageLockOnly`, --package-lock-only,
364364 // is `true`.
365- const needInfoOn = this . diff ? walk ( this . diff ) : [ ]
366- if ( needInfoOn . findIndex ( c => c . repository_url === NPM_REGISTRY_URL ) === - 1 ) {
365+ const needInfoOn = walk ( this . diff )
366+ if (
367+ needInfoOn . length ! ||
368+ needInfoOn . findIndex ( c => c . repository_url === NPM_REGISTRY_URL ) === - 1
369+ ) {
367370 // Nothing to check, hmmm already installed or all private?
368371 return await this [ kRiskyReify ] ( ...args )
369372 }
@@ -413,11 +416,9 @@ export async function reify(
413416 ret = await this [ kRiskyReify ] ( ...args )
414417 await this . loadActual ( )
415418 await this . buildIdealTree ( )
416- alerts = await getPackagesAlerts (
417- this ,
418- this . diff ? walk ( this . diff , { fix : true } ) : [ ] ,
419- { fixable : true }
420- )
419+ alerts = await getPackagesAlerts ( this , walk ( this . diff , { fix : true } ) , {
420+ fixable : true
421+ } )
421422 alerts = alerts . filter ( a => {
422423 const { key } = a
423424 if ( prev . has ( key ) ) {
0 commit comments