@nasl/cli 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -13672,7 +13672,11 @@ async function scanEntryFiles(projectRoot, patterns, logger) {
13672
13672
  */
13673
13673
  function extractDeps(content) {
13674
13674
  const deps = new Set();
13675
- const allMatches = content.matchAll(/app\.\w+\.[\w.]+/g); // 起码要2个点
13675
+ // 预处理:移除注释,避免注释影响依赖分析
13676
+ let processedContent = content
13677
+ .replace(/\/\/.*$/gm, '') // 移除单行注释 // ...
13678
+ .replace(/\/\*[\s\S]*?\*\//g, ''); // 移除多行注释 /* ... */
13679
+ const allMatches = processedContent.matchAll(/app\.\w+\.[\w.]+/g); // 起码要2个点
13676
13680
  for (const match of allMatches) {
13677
13681
  let dep = match[0];
13678
13682
  if (/Entity$|Entity\./.test(dep)) {