You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see that after change #3341 released in v14.0.0 the value returned by the parse function is correctly inferred to be a string in TypeScript, but only if you explicitly pass async: false
What pain point are you perceiving?.
I see that after change #3341 released in v14.0.0 the value returned by the
parse
function is correctly inferred to be astring
in TypeScript, but only if you explicitly passasync: false
However it's still a
Promise<string> | string
by defaultforcing me to cast the result, which is not ideal:
Describe the solution you'd like
Is there any reason why
parse
cannot treat the case where nooptions
are passed in the same way as when passingasync: false
? So users can writeIt seems to me the overloadedParse type could be simplified to
given that TypeScript will pick the first matching overload.
Happy to put together a PR if this makes sense, but I first wanted to check if I'm missing something because I'm not familiar with the full codebase.
The text was updated successfully, but these errors were encountered: