Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,13 @@ MORE INFO:

/**
* Check if a clack prompt was cancelled (Ctrl+C).
*
* Narrows with `Exclude<T, symbol>` 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<T>(value: T | symbol): asserts value is T {
function assertNotCancelled<T>(value: T): asserts value is Exclude<T, symbol> {
if (clack.isCancel(value)) {
clack.cancel("Setup cancelled.");
process.exit(0);
Expand Down
Loading