New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[N4S] Rule isNegative | isPositive #401
Comments
what should happen when: enforce(0).isNegative() // β or enforce(0).isPositive() // β |
Hey @sagivStekolshik, that's an excellent question. This means that we can arbitrarily decide how we want to treat it. For example, we could decide that in both cases it is enforce(0).isNegative() // false
enforce(0).isPositive() // false or even treat it always as enforce(0).isNegative() // true
enforce(0).isPositive() // true In our case, I think it would be most intuitive to start with the negative case:
So anything else would be considered as positive. The one exception is - how to deal with signed zero -0 === 0 // true
Object.is(-0, 0) // false But since signed zero is so rare in js, it might not even be worth looking at. |
My idea was using |
Hi @ealush |
Is this issue still open? |
Yes. No need to assign anyone, simply submit a pr and we'll get it merged π |
@ganeshpatil0101 do you have a branch you can share with those changes that do not work? I might be able to help. |
Add a new enforce rule:
The text was updated successfully, but these errors were encountered: