entkapp 4.5.0 → 4.5.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "name": "entkapp",
4
- "version": "4.5.0",
4
+ "version": "4.5.1",
5
5
  "description": "The Ultimate Enterprise Codebase Janitor. Faster than Knip with OXC integration, type-aware analysis, and automated structural healing. Fully standalone - solving what Knip cannot.",
6
6
  "type": "module",
7
7
  "main": "index.js",
@@ -42,9 +42,17 @@ export class OxcAnalyzer {
42
42
 
43
43
  // Fix: Use absolute path with forward slashes for OXC (most stable for Rust on Windows)
44
44
  const normalizedPath = filePath.replace(/\\/g, '/');
45
- const normalizedContent = cleanContent.replace(/\/([gimuy]*)([nh]+)([gimuy]*)/g, (match, p1, p2, p3) => {
46
- if (this.context.verbose) console.log(`[OXC] Normalizing regex flag: ${p2} at ${filePath}`);
47
- return `/${p1}${p3}`;
45
+ // FIX: The previous regex was too aggressive and matched patterns that are NOT regex literals
46
+ // (like paths in strings or comments), causing it to strip characters and create invalid regex flags
47
+ // for OXC. We now only target what looks like a regex literal at the end of a line or statement.
48
+ const normalizedContent = cleanContent.replace(/\/([gimuy]*)([nh]+)([gimuy]*)(?=\s|[;,\)]|$)/g, (match, p1, p2, p3) => {
49
+ // Only normalize if it's likely a regex (flags p1/p3 are valid JS flags)
50
+ const validJSFlags = /^[gimuy]*$/;
51
+ if (validJSFlags.test(p1) && validJSFlags.test(p3)) {
52
+ if (this.context.verbose) console.log(`[OXC] Normalizing regex flag: ${p2} at ${filePath}`);
53
+ return `/${p1}${p3}`;
54
+ }
55
+ return match;
48
56
  });
49
57
  let result;
50
58
  try {
@@ -435,4 +443,4 @@ let parsedResult;
435
443
  }
436
444
  return specifier.split('/')[0];
437
445
  }
438
- }
446
+ }