pruny 1.44.5 → 1.44.7

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 +5 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15465,7 +15465,7 @@ function deleteDeclaration(lines, startLine, name) {
15465
15465
  let foundMethodDefinition = false;
15466
15466
  let foundBodyOpening = false;
15467
15467
  let foundClosing = false;
15468
- const declRegex = /^(?:export\s+)?(?:(?:public|private|protected|static|async|readonly|abstract|override)\s+)*(?:(?:class|interface|type|enum|function|const|let|var)\s+)?[a-zA-Z0-9_$]+(?:<[^>]+>)?\s*(?:\(|=[^=])/;
15468
+ const declRegex = /^(?:export\s+)?(?:(?:public|private|protected|static|async|readonly|abstract|override)\s+)*(?:(?:class|interface|type|enum|function|const|let|var)\s+)?[a-zA-Z0-9_$]+(?:<[^>]+>)?(?:\s*:[^=\n(]+)?\s*(?:\(|=[^=])/;
15469
15469
  const classDeclRegex = /^(?:export\s+)?(?:default\s+)?(?:abstract\s+)?(?:class|interface|type|enum)\s+[a-zA-Z0-9_$]+/;
15470
15470
  const methodRefRegex = name ? new RegExp(`^\\s*(?:export\\s+)?(?:(?:async|static|readonly)\\s+)*(?:function\\s+)?\\b${name}\\b\\s*\\(`) : null;
15471
15471
  let currentDecoratorParenDepth = 0;
@@ -15494,11 +15494,14 @@ function deleteDeclaration(lines, startLine, name) {
15494
15494
  }
15495
15495
  continue;
15496
15496
  }
15497
+ let lineToSanitize = line;
15497
15498
  if (backtickCount % 2 !== 0) {
15498
15499
  inTemplateLiteral = true;
15500
+ const firstTick = lineForBackticks.indexOf("`");
15501
+ lineToSanitize = line.slice(0, firstTick);
15499
15502
  }
15500
15503
  const isDecorator = trimmed.startsWith("@");
15501
- const cleanLine = sanitizeLine(line);
15504
+ const cleanLine = sanitizeLine(lineToSanitize);
15502
15505
  const openBraces = (cleanLine.match(/{/g) || []).length;
15503
15506
  const closeBraces = (cleanLine.match(/}/g) || []).length;
15504
15507
  const openParens = (cleanLine.match(/\(/g) || []).length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pruny",
3
- "version": "1.44.5",
3
+ "version": "1.44.7",
4
4
  "description": "Find and remove unused Next.js API routes & Nest.js Controllers",
5
5
  "type": "module",
6
6
  "files": [