pruny 1.44.7 → 1.44.9
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.js +10 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14203,6 +14203,11 @@ function makeCodePattern(name) {
|
|
|
14203
14203
|
function escapeRegExp(string) {
|
|
14204
14204
|
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
14205
14205
|
}
|
|
14206
|
+
function stripComments(content) {
|
|
14207
|
+
let result = content.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
14208
|
+
result = result.replace(/\/\/[^\n]*/g, "");
|
|
14209
|
+
return result;
|
|
14210
|
+
}
|
|
14206
14211
|
function matchesFilter(path2, filter2) {
|
|
14207
14212
|
const lowerPath = path2.toLowerCase();
|
|
14208
14213
|
const appName = getAppName(path2).toLowerCase();
|
|
@@ -14393,7 +14398,8 @@ async function scanUnusedFiles(config) {
|
|
|
14393
14398
|
const currentFile = queue.shift();
|
|
14394
14399
|
const currentDir = dirname2(currentFile);
|
|
14395
14400
|
try {
|
|
14396
|
-
const
|
|
14401
|
+
const rawContent = readFileSync3(currentFile, "utf-8");
|
|
14402
|
+
const content = stripComments(rawContent);
|
|
14397
14403
|
let match2;
|
|
14398
14404
|
importRegex.lastIndex = 0;
|
|
14399
14405
|
while ((match2 = importRegex.exec(content)) !== null) {
|
|
@@ -16188,6 +16194,8 @@ async function scanBrokenLinks(config) {
|
|
|
16188
16194
|
const extracted = extractPath(match2);
|
|
16189
16195
|
if (!extracted)
|
|
16190
16196
|
continue;
|
|
16197
|
+
if (/\$\{/.test(extracted))
|
|
16198
|
+
continue;
|
|
16191
16199
|
const rawPath = normalizePath(extracted);
|
|
16192
16200
|
if (shouldSkipPath(rawPath))
|
|
16193
16201
|
continue;
|
|
@@ -16665,7 +16673,7 @@ function findImport(ident, source) {
|
|
|
16665
16673
|
return null;
|
|
16666
16674
|
}
|
|
16667
16675
|
function resolveModulePath(spec, fromFile, appDir, aliasMap) {
|
|
16668
|
-
|
|
16676
|
+
const candidates = [];
|
|
16669
16677
|
if (spec.startsWith(".")) {
|
|
16670
16678
|
candidates.push(resolve3(dirname5(fromFile), spec));
|
|
16671
16679
|
} else if (aliasMap.size > 0) {
|