Fix crash in require.extensions (#18788)

Co-authored-by: 190n <7763597+190n@users.noreply.github.com>
This commit is contained in:
190n
2025-04-04 19:11:32 -07:00
committed by GitHub
parent d1ac711a7e
commit c86097aeb0
10 changed files with 65876 additions and 53346 deletions

View File

@@ -554,6 +554,9 @@ export function ospath(path: string) {
*/
export async function toMatchNodeModulesAt(lockfile: any, root: string) {
function shouldSkip(pkg: any, dep: any): boolean {
// Band-aid as toMatchNodeModulesAt will sometimes ask this function
// if a package depends on itself
if (pkg?.name === dep?.name) return true;
return (
!pkg ||
!pkg.resolution ||