Open MattRCole opened 3 years ago
Hey @MattRCole,
I would be all in for such a utility. You had a good practise there with the type system there, well done! But I think that we can indeed do shorter by shipping a Split
type that will split on ''
empty strings and then we can retrieve the length from there - just to keep it all more generic.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
🍩 Feature Request
Is your feature request related to a problem?
It is extremely difficult to derive the length of a string using typescript typings.
Unlike the relatively simple way one can get the length of an array:
The length of a string is very hard to determine
Describe the solution you'd like
A first stab at a solution:
This type might be too "beefy" though and could probably be cut down. It also requires the use of TS 4.1.
Describe alternatives you've considered
I've considered putting in a pull request, but the proposed solution probably needs a lot work, so I've made this feature suggestion instead.
Teachability, Documentation, Adoption, Migration Strategy
A function description would probably be sufficient:
Edit: Clarity