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
It seems pretty common that we run into issues with a string being empty when it's not supposed to. These are some common issues I see:
An API parameter is meant to be a string, but an empty string isn't valid.
We mean to default an empty string to something else, such as '-1', but our ESLint config encourages us to use nullish coalescing ?? instead of ||. Obviously these don't work the same in cases where you have an empty string.
anyways, my suggestion is to create a type called NonEmptyString. According to this Stackoverflow, the best way to accomplish this is with a very verbose template literal with any non-empty character followed by a string
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
The funding will be given to active contributors.
Thank you in advance for helping prioritize & fund our backlog.
The text was updated successfully, but these errors were encountered:
It seems pretty common that we run into issues with a string being empty when it's not supposed to. These are some common issues I see:
'-1'
, but our ESLint config encourages us to use nullish coalescing??
instead of||
. Obviously these don't work the same in cases where you have an empty string.anyways, my suggestion is to create a type called
NonEmptyString
. According to this Stackoverflow, the best way to accomplish this is with a very verbose template literal with any non-empty character followed by a stringUpvote & Fund
The text was updated successfully, but these errors were encountered: