From fe8c9a2b0a6291c89ee4386ef28e19a6075b99cb Mon Sep 17 00:00:00 2001 From: Cedric van Putten Date: Mon, 1 Apr 2024 17:11:36 +0200 Subject: [PATCH] fix: use proper package name for org-related packages --- src/utils/package.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/package.ts b/src/utils/package.ts index 536a13c..bbeeefc 100644 --- a/src/utils/package.ts +++ b/src/utils/package.ts @@ -1,5 +1,5 @@ -/** Pattern to match the last `node_modules/` occurance in a string */ -const NODE_MODULES_NAME_PATTERN = /(?:.*\/)?node_modules\/([^/]+)/i; +/** Pattern to match the last `node_modules/@/` or `node_modules/` occurrence in a string */ +const NODE_MODULES_NAME_PATTERN = /(?:.*\/)?node_modules\/((?:@[^/]+\/[^/]+)|[^/]+)/i; /** A simple map to return previously resolved package names from paths */ const packageNameCache = new Map();