diff --git a/src/cli/commands.ts b/src/cli/commands.ts index 89e4d3a..77a7048 100644 --- a/src/cli/commands.ts +++ b/src/cli/commands.ts @@ -82,8 +82,13 @@ MORE INFO: /** * Check if a clack prompt was cancelled (Ctrl+C). + * + * Narrows with `Exclude` rather than taking `T | symbol`. Clack + * types its cancel value as a `unique symbol`, which does not bind to a plain + * `symbol` slot, so inference used to hand `T` the whole union and the + * assertion narrowed nothing. */ -function assertNotCancelled(value: T | symbol): asserts value is T { +function assertNotCancelled(value: T): asserts value is Exclude { if (clack.isCancel(value)) { clack.cancel("Setup cancelled."); process.exit(0);