diff --git a/examples/weather/src/index.tsx b/examples/weather/src/index.tsx index dce3c7425..2dcf862ec 100644 --- a/examples/weather/src/index.tsx +++ b/examples/weather/src/index.tsx @@ -201,7 +201,7 @@ async function fetchWeather() { } } -setInterval(fetchWeather, 5000); +clearInterval(window.__interval); window.__interval = setInterval(fetchWeather, 5000); fetchWeather(); // Gauge does not expose a public setColor() method, so dynamic color 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; 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 {