TypeScript Positive Integer Type
This is how you define the PositiveInteger dependent type in TypeScript without using type predicate functions or branded (tagged) types: type PositiveInteger<T extends number> = `${T}` extends '0' | `-${any}` | `${any}.${any}` ? never : T It can ...
Feb 1, 20231 min read4.2K
