is-odd
is-odd copied to clipboard
No Typescript definitions
Can I suggest also:
type oddNumber = twoMilOdd | fourMilOdd | ... etc.
Where:
type twoMilOdd = 1 | 3 | 5 | ... etc.
So isOdd can be a type guard:
function isOdd(value: number): value is oddNumber { ... }
This is what this project has needed all along!
Also no factories or adapters.
Nice! we can get compile-time checks!