diff --git a/examples/calculator/src/index.tsx b/examples/calculator/src/index.tsx index 852911990..a2ed8284b 100644 --- a/examples/calculator/src/index.tsx +++ b/examples/calculator/src/index.tsx @@ -403,7 +403,7 @@ class CalculatorApp extends Widget { } private evaluate() { - if (this.expression.trim() === "") return; + if (this.expression.trim().length === 0) return; const oldExpr = this.expression; this.result = safeEval(this.expression); if (this.result !== null && !this.result.startsWith("Error")) { diff --git a/examples/chat-app/src/index.tsx b/examples/chat-app/src/index.tsx index a3a2ddb14..0d405714e 100644 --- a/examples/chat-app/src/index.tsx +++ b/examples/chat-app/src/index.tsx @@ -257,7 +257,7 @@ function parseBlocks(text: string): Block[] { } // ── Handle Paragraphs ──────────────────────── - if (line.trim() === '') { + if (line.trim().length === 0) { blocks.push({ type: 'paragraph', text: '', diff --git a/packages/ui/src/prompts.ts b/packages/ui/src/prompts.ts index b92bb28ba..b248a6ac4 100644 --- a/packages/ui/src/prompts.ts +++ b/packages/ui/src/prompts.ts @@ -113,7 +113,7 @@ async function promptSelect(options: SelectPromptOptions): Promis return; } const n = parseInt(trimmed, 10); - if (!isNaN(n) && n >= 1 && n <= choices.length) { + if (!Number.isNaN(n) && n >= 1 && n <= choices.length) { rl.close(); resolve(choices[n - 1].value); return;