pruny 1.44.8 → 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.
Files changed (2) hide show
  1. package/dist/index.js +7 -1
  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 content = readFileSync3(currentFile, "utf-8");
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pruny",
3
- "version": "1.44.8",
3
+ "version": "1.44.9",
4
4
  "description": "Find and remove unused Next.js API routes & Nest.js Controllers",
5
5
  "type": "module",
6
6
  "files": [