@aiready/pattern-detect 0.14.15 → 0.14.17

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/cli.js CHANGED
@@ -191,7 +191,7 @@ function extractBlocks(file, content) {
191
191
  }
192
192
  const blocks = [];
193
193
  const lines = content.split("\n");
194
- const blockRegex = /^\s*(?:export\s+)?(?:async\s+)?(function|class|const|interface|type)\s+([a-zA-Z0-9_]+)|^\s*(app\.(?:get|post|put|delete|patch|use))\(/gm;
194
+ const blockRegex = /^\s*(?:export\s+)?(?:async\s+)?(?:public\s+|private\s+|protected\s+|internal\s+|static\s+|readonly\s+|virtual\s+|abstract\s+|override\s+)*(function|class|interface|type|enum|record|struct|void|func|[a-zA-Z0-9_<>\[\]]+)\s+([a-zA-Z0-9_]+)(?:\s*\(|(?:\s+extends|\s+implements|\s+where)?\s*\{)|^\s*(?:export\s+)?const\s+([a-zA-Z0-9_]+)\s*=\s*[a-zA-Z0-9_.]+\.object\(|^\s*(app\.(?:get|post|put|delete|patch|use))\(/gm;
195
195
  let match;
196
196
  while ((match = blockRegex.exec(content)) !== null) {
197
197
  const startLine = content.substring(0, match.index).split("\n").length;
@@ -200,9 +200,12 @@ function extractBlocks(file, content) {
200
200
  if (match[1]) {
201
201
  type = match[1];
202
202
  name = match[2];
203
+ } else if (match[3]) {
204
+ type = "const";
205
+ name = match[3];
203
206
  } else {
204
207
  type = "handler";
205
- name = match[3];
208
+ name = match[4];
206
209
  }
207
210
  let endLine = -1;
208
211
  let openBraces = 0;
package/dist/cli.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  analyzePatterns,
4
4
  filterBySeverity,
5
5
  generateSummary
6
- } from "./chunk-7S4AUL5S.mjs";
6
+ } from "./chunk-6YUGU4P4.mjs";
7
7
 
8
8
  // src/cli.ts
9
9
  import { Command } from "commander";
package/dist/index.js CHANGED
@@ -215,7 +215,7 @@ function extractBlocks(file, content) {
215
215
  }
216
216
  const blocks = [];
217
217
  const lines = content.split("\n");
218
- const blockRegex = /^\s*(?:export\s+)?(?:async\s+)?(function|class|const|interface|type)\s+([a-zA-Z0-9_]+)|^\s*(app\.(?:get|post|put|delete|patch|use))\(/gm;
218
+ const blockRegex = /^\s*(?:export\s+)?(?:async\s+)?(?:public\s+|private\s+|protected\s+|internal\s+|static\s+|readonly\s+|virtual\s+|abstract\s+|override\s+)*(function|class|interface|type|enum|record|struct|void|func|[a-zA-Z0-9_<>\[\]]+)\s+([a-zA-Z0-9_]+)(?:\s*\(|(?:\s+extends|\s+implements|\s+where)?\s*\{)|^\s*(?:export\s+)?const\s+([a-zA-Z0-9_]+)\s*=\s*[a-zA-Z0-9_.]+\.object\(|^\s*(app\.(?:get|post|put|delete|patch|use))\(/gm;
219
219
  let match;
220
220
  while ((match = blockRegex.exec(content)) !== null) {
221
221
  const startLine = content.substring(0, match.index).split("\n").length;
@@ -224,9 +224,12 @@ function extractBlocks(file, content) {
224
224
  if (match[1]) {
225
225
  type = match[1];
226
226
  name = match[2];
227
+ } else if (match[3]) {
228
+ type = "const";
229
+ name = match[3];
227
230
  } else {
228
231
  type = "handler";
229
- name = match[3];
232
+ name = match[4];
230
233
  }
231
234
  let endLine = -1;
232
235
  let openBraces = 0;
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  generateSummary,
10
10
  getSeverityLabel,
11
11
  getSmartDefaults
12
- } from "./chunk-7S4AUL5S.mjs";
12
+ } from "./chunk-6YUGU4P4.mjs";
13
13
  export {
14
14
  PatternDetectProvider,
15
15
  Severity,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/pattern-detect",
3
- "version": "0.14.15",
3
+ "version": "0.14.17",
4
4
  "description": "Semantic duplicate pattern detection for AI-generated code - finds similar implementations that waste AI context tokens",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "commander": "^14.0.0",
47
47
  "chalk": "^5.3.0",
48
- "@aiready/core": "0.21.15"
48
+ "@aiready/core": "0.21.17"
49
49
  },
50
50
  "devDependencies": {
51
51
  "tsup": "^8.3.5",