-
Notifications
You must be signed in to change notification settings - Fork 230
fix: resolve 4 bugs in termui #3584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ export function collectDeps(content: string): string[] { | |
| const deps = new Set<string>(); | ||
| let m: RegExpExecArray | null; | ||
| while ((m = re.exec(content)) !== null) deps.add(m[1]!); | ||
| return [...deps].sort(); | ||
| return [...deps].sort((a, b) => a - b); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
if rg -nF 'sort((a, b) => a - b)' scripts/build-registry.ts; then
echo "Numeric comparator still used for string dependencies." >&2
exit 1
fi
rg -n -A12 -B2 'collects unique sorted `@termuijs/`\* specifiers' scripts/build-registry.test.tsRepository: Karanjot786/TermUI Length of output: 256 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
echo "--- scripts/build-registry.ts ---"
cat -n scripts/build-registry.ts
echo "--- relevant test section ---"
sed -n '110,150p' scripts/build-registry.test.ts | cat -n
echo "--- TypeScript version/config availability ---"
if [ -f package.json ]; then jq '.devDependencies.typescript, .scripts' package.json; fi
if [ -f tsconfig.json ]; then jq '.compilerOptions' tsconfig.json; fiRepository: Karanjot786/TermUI Length of output: 25168 Use a string comparator for dependency names.
Proposed fix- return [...deps].sort((a, b)章 a - b);
+ return [...deps].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| } | ||
|
|
||
| export function toSlug(name: string): string { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Reject overlong hexadecimal entities instead of truncating them.
The regular expression accepts any number of hexadecimal digits, but
entity.slice(2, 10)keeps only the first eight. For example,AbecomesU+0004instead ofA. Check the digit count before parsing and returnmatchwhen the entity exceeds the eight-digit limit.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents