consola icon indicating copy to clipboard operation
consola copied to clipboard

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

Open Jannchie opened this issue 10 months ago • 1 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

Jannchie avatar Sep 04 '23 18:09 Jannchie

See https://github.com/unjs/consola/issues/251#issue-1952779657

samuelstroschein avatar Oct 19 '23 17:10 samuelstroschein