Type-checked non-empty strings
exploring-better-ways.bellroy.com
Type-checked non-empty strings
1–10 of 51 posts
Re: Type-checked non-empty strings
#2https://www.typescriptlang.org/docs/handbook/utility-types.h...
Edit: nevermind, LLM fooled me.
Re: Type-checked non-empty strings
#3Language is not mentioned in a title, so my first thought was about TypeScript type wizardry. Turns out it's as simple as `Exclude `. https://www.typescriptlang.org/docs/handbook/utility-types.h... Edit: nevermind, LLM fooled me.
Re: Type-checked non-empty strings
#4Language is not mentioned in a title, so my first thought was about TypeScript type wizardry. Turns out it's as simple as `Exclude `. https://www.typescriptlang.org/docs/handbook/utility-types.h... Edit: nevermind, LLM fooled me.
Re: Type-checked non-empty strings
#5Turns out it's some kind of bags and accessories brand!
Re: Type-checked non-empty strings
#6Re: Type-checked non-empty strings
#7"Huh never heard of Bellroy... I wonder what they're using Haskell for..." Turns out it's some kind of bags and accessories brand!
Re: Type-checked non-empty strings
#8I added a similar type — “non-empty-string” to a typechecker for PHP, and it’s been adopted widely in the PHP ecosystem. It turns out to be pretty handy, especially when there’s a full type system to support it.
Re: Type-checked non-empty strings
#9Language is not mentioned in a title, so my first thought was about TypeScript type wizardry. Turns out it's as simple as `Exclude `. https://www.typescriptlang.org/docs/handbook/utility-types.h... Edit: nevermind, LLM fooled me.
Re: Type-checked non-empty strings
#10Language is not mentioned in a title, so my first thought was about TypeScript type wizardry. Turns out it's as simple as `Exclude `. https://www.typescriptlang.org/docs/handbook/utility-types.h... Edit: nevermind, LLM fooled me.
It's simple, and it doesn't work as `Exclude` only applies to union types. For type `string` it just returns the same type `string`.