Open motherthestate opened 5 months ago
Since isNumber currently only checks if the value is a number or infinity.
function px (value: number | string) { if (G.isNumber(value)) return `${value}px` return px } px(1/0) // "Infinitypx" // Proposal: G.isFinite(1/0) // false
To be clear this does not actually add a new type guard since infinity is a number in javascript and typescript does not make the distinction.
Hi. I made a PR to resolve this issue. please have a look and let me know if it's right.
Since isNumber currently only checks if the value is a number or infinity.
To be clear this does not actually add a new type guard since infinity is a number in javascript and typescript does not make the distinction.