Skip to content

fix: resolve 4 bugs in termui - #3534

Closed
saurabhhhcodes wants to merge 1 commit into
Karanjot786:mainfrom
saurabhhhcodes:fix/termui-96753
Closed

fix: resolve 4 bugs in termui#3534
saurabhhhcodes wants to merge 1 commit into
Karanjot786:mainfrom
saurabhhhcodes:fix/termui-96753

Conversation

@saurabhhhcodes

Copy link
Copy Markdown
Contributor

Description

This PR fixes real bugs found in the codebase:

  • Simplified empty-string validation: comparing trim() to '' misses whitespace-only input; .trim().length === 0 is explicit.
  • Added Number.EPSILON to Math.round: prevents floating-point drift (e.g. 1.005 * 100 rounding to 100 instead of 101).
  • Added Number.EPSILON to Math.round: prevents floating-point drift (e.g. 1.005 * 100 rounding to 100 instead of 101).
  • Fixed default sort: .sort() coerces elements to strings, so [10, 9, 2] sorts as [10, 2, 9]; numeric comparator sorts correctly.

Type of Change

  • Bug fix (non-breaking change fixing an issue)

How Has This Been Tested?

  • Local manual testing

Checklist

  • My code follows the style guidelines
  • I have performed a self-review

Related Issue

Ref: #3533

@github-actions github-actions Bot added type:bug +10 pts. Bug fix. area:examples Example apps. area:ui @termuijs/ui area:dev-server @termuijs/dev-server and removed type:bug +10 pts. Bug fix. labels Aug 5, 2026
@saurabhhhcodes saurabhhhcodes mentioned this pull request Aug 5, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-server @termuijs/dev-server area:examples Example apps. area:ui @termuijs/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant