samuelmarina / is-odd

Is a number odd?
163 stars 21 forks source link

No Typescript definitions #22

Open dcollien opened 2 years ago

dcollien commented 2 years ago

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 { ... }
i-am-gizm0 commented 2 years ago

This is what this project has needed all along!

dogweather commented 3 months ago

Also no factories or adapters.

Rudxain commented 3 months ago

Nice! we can get compile-time checks!