Open som-sm opened 2 months ago
Hey @ssmkhrj , thanks for the message and effort!
You may be completely right here. We have made a lot of code changes to every method when we introduced IsStringLiteral and certain methods might not need them.
Whenever I have some sparing time I'll check your supposition but feel free to send a PR in the meantime. If you do so, make sure the tests are successful (the CI will ultimately tell us) and your use case is covered ;)
Cheers
So, the
TrimStart
utility when instantiated with any infinite string type likestring
,Uppercase<string>
,on${Capitalize<string>}
etc returnsstring
.This behaviour is surely not incorrect, but feels like we can make the types more precise just by removing the
IsStringLiteral
check.Which means we now get more precise types:
So, the first three cases return back exactly the same type they received, while the last case correctly removes the leading spaces from the input string, resulting in more precise types without being inaccurate.