@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/README.md +6 -0
- package/dist/chunk-6YUGU4P4.mjs +914 -0
- package/dist/chunk-INEOYHUM.mjs +911 -0
- package/dist/cli.js +5 -2
- package/dist/cli.mjs +1 -1
- package/dist/index.js +5 -2
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
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|
|
|
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[
|
|
208
|
+
name = match[4];
|
|
206
209
|
}
|
|
207
210
|
let endLine = -1;
|
|
208
211
|
let openBraces = 0;
|
package/dist/cli.mjs
CHANGED
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|
|
|
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[
|
|
232
|
+
name = match[4];
|
|
230
233
|
}
|
|
231
234
|
let endLine = -1;
|
|
232
235
|
let openBraces = 0;
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/pattern-detect",
|
|
3
|
-
"version": "0.14.
|
|
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.
|
|
48
|
+
"@aiready/core": "0.21.17"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"tsup": "^8.3.5",
|