Newbie here...
Is it possible to use GreaterThan type for the function/method parameters?
when I write the following function:
import type {GreaterThan} from 'type-fest'
function printNumberOfBooks <N extends number> (numberOfBooks: GreaterThan<N, 0>): void {
console.log(numberOfBooks)
}
and... :
printNumberOfBooks(2)
I get the following typescript error:
Argument of type 'number' is not assignable to parameter of type 'never'
It took me hours... I didn't find a solution
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too