pruny 1.9.0 → 1.9.2

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 +10 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9205,6 +9205,7 @@ async function scanUnusedFiles(config) {
9205
9205
  "**/error.{ts,tsx,js,jsx}",
9206
9206
  "**/not-found.{ts,tsx,js,jsx}",
9207
9207
  "**/middleware.{ts,js}",
9208
+ "**/proxy.{ts,js}",
9208
9209
  "**/instrumentation.{ts,js}",
9209
9210
  "next.config.{js,mjs,ts}",
9210
9211
  "tailwind.config.{js,ts}",
@@ -9446,7 +9447,7 @@ async function scanUnusedExports(config) {
9446
9447
  const lines = content.split(`
9447
9448
  `);
9448
9449
  let inMultilineComment = false;
9449
- let inTemplate = false;
9450
+ let inTemplateLiteral = false;
9450
9451
  for (const line of lines) {
9451
9452
  const trimmed = line.trim();
9452
9453
  if (trimmed.includes("/*"))
@@ -9457,6 +9458,12 @@ async function scanUnusedExports(config) {
9457
9458
  }
9458
9459
  if (inMultilineComment)
9459
9460
  continue;
9461
+ const backtickCount = (line.match(/`/g) || []).length;
9462
+ if (backtickCount % 2 !== 0) {
9463
+ inTemplateLiteral = !inTemplateLiteral;
9464
+ }
9465
+ if (inTemplateLiteral)
9466
+ continue;
9460
9467
  if (trimmed.startsWith("//"))
9461
9468
  continue;
9462
9469
  if (trimmed.includes("{/*") || trimmed.includes("*/}"))
@@ -9731,8 +9738,8 @@ var DEFAULT_CONFIG = {
9731
9738
  "public/opengraph-image.*",
9732
9739
  "public/apple-icon.*",
9733
9740
  "public/icon.*",
9734
- "proxy.*",
9735
- "middleware.*"
9741
+ "**/proxy.*",
9742
+ "**/middleware.*"
9736
9743
  ]
9737
9744
  },
9738
9745
  extensions: [".ts", ".tsx", ".js", ".jsx"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pruny",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "description": "Find and remove unused Next.js API routes & Nest.js Controllers",
5
5
  "type": "module",
6
6
  "files": [