$ cnpm install @putout/plugin-convert-bitwise-to-logical
The bitwise OR operator (
|) returns a1in each bit position for which the corresponding bits of either or both operands are1s.The operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones).
(c) MDN
????Putout plugin adds ability to convert bitwise to logical operator, when one of operands is not a number,
since mostly likely it is an error.
Merged to @putout/plugin-logical-expressions.
npm i @putout/plugin-convert-bitwise-to-logical -D
{
"rules": {
"convert-bitwise-to-logical": "on"
}
}
a | !b;
a || !b;
MIT
Copyright 2013 - present © cnpmjs.org | Home |