I suggest improving the return type inference. The main function returns a union of type but the return type can be narrowed to the type specified by the value of the output option. By default, a string value is returned, because the default value of the output option is string. Narrowing the return type based on output option would be great.
I suggest improving the return type inference. The main function returns a union of type but the return type can be narrowed to the type specified by the value of the
output
option. By default, astring
value is returned, because the default value of theoutput
option isstring
. Narrowing the return type based onoutput
option would be great.