Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript: prompt could return Symbol('clack:cancel') #234

Open
Jannchie opened this issue Sep 4, 2023 · 1 comment
Open

typescript: prompt could return Symbol('clack:cancel') #234

Jannchie opened this issue Sep 4, 2023 · 1 comment

Comments

@Jannchie
Copy link

Jannchie commented Sep 4, 2023

Environment

v3.2.3

Reproduction

const res = await consola.prompt('Enter somethings', {type: 'text'}) 

When executing the above code, if you press ctrl + c to cancel, the value of res is Symbol('clack:cancel')

Describe the bug

However, res is annotated as string.

I'm not sure if we should set the return value type to string | symbol or make it output an empty string or undefined.

Is this an upstream issue (in @clack/core)?

Additional context

No response

Logs

No response

@samuelstroschein
Copy link

See #251 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants