Repository navigation
fix: resolve 2 bugs #3372
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
fix: resolve 2 bugs #3372
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 |
|---|---|---|
|
|
@@ -182,8 +182,8 @@ function _pathsEqual(a: number[], b: number[]): boolean { | |
|
|
||
| function _valuesEqual(a: string[], b: string[]): boolean { | ||
| if (a.length !== b.length) return false; | ||
| const sortedA = [...a].sort(); | ||
| const sortedB = [...b].sort(); | ||
| const sortedA = [...a].sort((a, b) => a - b); | ||
| const sortedB = [...b].sort((a, b) => a - b); | ||
|
Comment on lines
+185
to
+186
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: #!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files | rg '(^|/)(TreeSelect|build-registry)\.(ts|tsx)$|packages/tsconfig|scripts/.*ts$' || true
echo "== TreeSelect relevant sections =="
if [ -f packages/ui/src/TreeSelect.ts ]; then
wc -l packages/ui/src/TreeSelect.ts
sed -n '150,210p' packages/ui/src/TreeSelect.ts
fi
echo "== build-registry relevant sections =="
if [ -f scripts/build-registry.ts ]; then
wc -l scripts/build-registry.ts
sed -n '30,65p' scripts/build-registry.ts
fi
echo "== TypeScript strict config snippets =="
for f in packages/ui/tsconfig.json tsconfig.json packages/tsconfig.json; do
if [ -f "$f" ]; then
echo "--- $f"
cat "$f"
fi
done
echo "== package scripts / dependency type context =="
if [ -f scripts/build-registry.ts ]; then
rg -n "deps|dependenc|sorted|sort\\(" scripts/build-registry.ts packages --glob '*.ts' --glob '*.tsx' -C 2 || true
fi
echo "== standalone JS subtraction comparator behavior =="
node - <<'JS'
const values = ["apples", "bananas", "Oranges"];
const sortedSub = [...values].sort((a, b) => a - b);
const sortedLex = [...values].sort((a, b) => a.localeCompare(b));
console.log(JSON.stringify({ sortedSub, sortedLex }));
for (const pair of [["a", "b"], ["1", "2"], ["Oranges", "apples"]]) {
const [a, b] = pair;
console.log(`${a} - ${b} = ${a - b}`);
}
JSRepository: Karanjot786/TermUI Length of output: 50374 Use a string comparator for the sorted selection comparisons.
📍 Affects 2 files
🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| for (let i = 0; i < sortedA.length; i++) { | ||
| if (sortedA[i] !== sortedB[i]) return false; | ||
| } | ||
|
|
||
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.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 5143
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 5595
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 759
Reject overlong and out-of-range numeric entities before decoding.
slice(..., 10)takes nine characters after the#; decimal entities like�can decode from a prefix. Hex decoding slices after#x, so malformed hex-only input or excessively long hex values can also pass the predicate. Limit the regex to at most eight digits, parse the complete entity suffix, and reject values above0x10FFFFbefore callingString.fromCodePoint.🤖 Prompt for AI Agents