-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.2.3: regex generation is a slippery slope
- Loading branch information
1 parent
1197faf
commit a7d8413
Showing
4 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "llm-context", | ||
"type": "module", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"packageManager": "[email protected]+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c", | ||
"description": "A CLI tool to build context files to attach to Large Language Models (LLMs).", | ||
"author": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export function matchesPattern(path: string, pattern: string): boolean { | ||
const regexString = pattern | ||
.replace(/\*/g, '.*') | ||
.replace(/\?/g, '.') | ||
const escaped = pattern.replace(/\./g, '\\.') | ||
const regexString = escaped.replace(/\*/g, '.*') | ||
|
||
const regex = new RegExp(regexString) | ||
return regex.test(path) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters