@@ -137,7 +137,7 @@ export async function npmFix(
137137 const sortedInfoEntries = [ ...infoByPkgName . entries ( ) ] . sort ( ( a , b ) =>
138138 naturalCompare ( a [ 0 ] , b [ 0 ] )
139139 )
140- infoByPkgNameLoop : for ( const { 0 : name , 1 : infos } of sortedInfoEntries ) {
140+ infoEntriesLoop : for ( const { 0 : name , 1 : infos } of sortedInfoEntries ) {
141141 logger . log ( `Processing vulnerable package: ${ name } ` )
142142 logger . indent ( )
143143 spinner ?. indent ( )
@@ -151,13 +151,13 @@ export async function npmFix(
151151 logger . warn ( `Unexpected condition: No packument found for ${ name } \n` )
152152 logger . dedent ( )
153153 spinner ?. dedent ( )
154- continue
154+ continue infoEntriesLoop
155155 }
156156
157157 const availableVersions = Object . keys ( packument . versions )
158158 const warningsForAfter = new Set < string > ( )
159159
160- for ( const pkgJsonPath of pkgJsonPaths ) {
160+ pkgJsonPathsLoop: for ( const pkgJsonPath of pkgJsonPaths ) {
161161 const pkgPath = path . dirname ( pkgJsonPath )
162162 const isWorkspaceRoot =
163163 pkgJsonPath === pkgEnvDetails . editablePkgJson . filename
@@ -180,7 +180,7 @@ export async function npmFix(
180180 logger . warn (
181181 `Unexpected condition: Lockfile entries not found for ${ name } .\n`
182182 )
183- continue
183+ continue pkgJsonPathsLoop
184184 }
185185
186186 // Always re-read the editable package.json to avoid stale mutations
@@ -190,7 +190,7 @@ export async function npmFix(
190190 editable : true
191191 } )
192192
193- for ( const oldVersion of oldVersions ) {
193+ oldVersionsLoop: for ( const oldVersion of oldVersions ) {
194194 const oldId = `${ name } @${ oldVersion } `
195195 const oldPurl = idToPurl ( oldId )
196196
@@ -199,10 +199,10 @@ export async function npmFix(
199199 logger . warn (
200200 `Unexpected condition: Arborist node not found, skipping ${ oldId } `
201201 )
202- continue
202+ continue oldVersionsLoop
203203 }
204204
205- for ( const {
205+ infosLoop: for ( const {
206206 firstPatchedVersionIdentifier,
207207 vulnerableVersionRange
208208 } of infos . values ( ) ) {
@@ -220,7 +220,7 @@ export async function npmFix(
220220 warningsForAfter . add (
221221 `No update applied. ${ oldId } needs >=${ firstPatchedVersionIdentifier } `
222222 )
223- continue
223+ continue infosLoop
224224 }
225225
226226 const newVersionRange = applyRange ( oldVersion , newVersion , rangeStyle )
@@ -258,7 +258,7 @@ export async function npmFix(
258258 // eslint-disable-next-line no-await-in-loop
259259 actualTree = await install ( arb , { cwd } )
260260 }
261- continue
261+ continue infosLoop
262262 }
263263
264264 spinner ?. start ( )
@@ -291,14 +291,14 @@ export async function npmFix(
291291 // eslint-disable-next-line no-await-in-loop
292292 if ( await prExistForBranch ( owner , repo , branch ) ) {
293293 debugLog ( `Branch "${ branch } " exists, skipping PR creation.` )
294- continue
294+ continue infosLoop
295295 }
296296 // eslint-disable-next-line no-await-in-loop
297297 if ( await gitRemoteBranchExists ( branch , cwd ) ) {
298298 debugLog (
299299 `Remote branch "${ branch } " exists, skipping PR creation.`
300300 )
301- continue
301+ continue infosLoop
302302 }
303303
304304 const moddedFilepaths =
@@ -314,7 +314,7 @@ export async function npmFix(
314314 logger . warn (
315315 'Unexpected condition: Nothing to commit, skipping PR creation.'
316316 )
317- continue
317+ continue infosLoop
318318 }
319319
320320 if (
@@ -329,7 +329,7 @@ export async function npmFix(
329329 logger . warn (
330330 'Unexpected condition: Push failed, skipping PR creation.'
331331 )
332- continue
332+ continue infosLoop
333333 }
334334 // eslint-disable-next-line no-await-in-loop
335335 await cleanupOpenPrs ( owner , repo , oldPurl , newVersion , {
@@ -385,7 +385,7 @@ export async function npmFix(
385385 )
386386 }
387387 if ( ++ count >= limit ) {
388- break infoByPkgNameLoop
388+ break infoEntriesLoop
389389 }
390390 }
391391 }
0 commit comments