unjs / consola

🐨 Elegant Console Logger for Node.js and Browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Jannchie opened this issue · comments

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