Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't have it handy but with template literal types I was able to have a type of "stripped strings" (that is, strings without leading or trailing whitespace) that seemed surprisingly usable - string literals would match (or not, as appropriate) with no boilerplate, while dynamic strings would need to be fed to a cleaning function.

I never put it in production, partially because of concerns over maintainability but far more because I had no need for it.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: