diff --git a/examples/forms-and-validation/src/index.tsx b/examples/forms-and-validation/src/index.tsx index e8a9bb4ea..4ac42a672 100644 --- a/examples/forms-and-validation/src/index.tsx +++ b/examples/forms-and-validation/src/index.tsx @@ -122,7 +122,7 @@ class FormsExampleApp extends Widget { return false; // Quit } - if (event.key === 'c' && event.ctrl === false) { + if (event.key === 'c' && event.ctrl !) { this.modal.show(); return true; } diff --git a/examples/pomodoro-timer/src/index.tsx b/examples/pomodoro-timer/src/index.tsx index cad749f32..6444f948d 100644 --- a/examples/pomodoro-timer/src/index.tsx +++ b/examples/pomodoro-timer/src/index.tsx @@ -182,7 +182,7 @@ class GradientProgressBar extends Widget { const attrs = styleToCellAttrs(this._style); - const label = this._showLabel ? ` ${Math.round(this._value * 100)}%` : ''; + const label = this._showLabel ? ` ${Math.round(this._value * 100 + Number.EPSILON)}%` : ''; const barWidth = Math.max(0, width - label.length); const filled = this._value <= 0 ? 0 : Math.round(barWidth * this._value); const empty = barWidth - filled; diff --git a/packages/ui/src/Switch.ts b/packages/ui/src/Switch.ts index 7c24941a5..d9a1e01d0 100644 --- a/packages/ui/src/Switch.ts +++ b/packages/ui/src/Switch.ts @@ -114,7 +114,7 @@ export class Switch extends Widget { if (width <= 0) return; const attrs = styleToCellAttrs(this.style); - const knobPos = Math.round(this._animProgress * 2); + const knobPos = Math.round(this._animProgress * 2 + Number.EPSILON); const transitioning = this._animProgress > 0 && this._animProgress < 1; let trackChars: string[]; diff --git a/scripts/build-registry.ts b/scripts/build-registry.ts index f84844538..01abfbde1 100644 --- a/scripts/build-registry.ts +++ b/scripts/build-registry.ts @@ -44,7 +44,7 @@ export function collectDeps(content: string): string[] { const deps = new Set(); let m: RegExpExecArray | null; while ((m = re.exec(content)) !== null) deps.add(m[1]!); - return [...deps].sort(); + return [...deps].sort((a, b) => a - b); } export function toSlug(name: string): string {