Skip to content

Commit 555d39c

Browse files
committed
Tweak extractOverridesFromPnpmLockSrc regexp again
1 parent b7a1a2c commit 555d39c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/utils/pnpm.mts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ import type { LockfileObject, PackageSnapshot } from '@pnpm/lockfile.fs'
1313
import type { SemVer } from 'semver'
1414

1515
export function extractOverridesFromPnpmLockSrc(lockfileContent: any): string {
16-
return typeof lockfileContent === 'string'
17-
? (/^overrides:\r?\n(?: {2}.+(?:\r?\n)*)+/m.exec(lockfileContent)?.[0] ??
18-
'')
19-
: ''
16+
let match
17+
if (typeof lockfileContent === 'string') {
18+
match = /^overrides:(?:\r?\n {2}.+)+(?:\r?\n)*/m.exec(lockfileContent)?.[0]
19+
}
20+
return match ?? ''
2021
}
2122

2223
export async function extractPurlsFromPnpmLockfile(

0 commit comments

Comments
 (0)