condition-handler
Installation
npm i condition-handler# or yarn add condition-handler
Or you can use minified file.
Using
You can use any operators from the list
!
&&
||
===
==
!==
!=
>
>=
<
<=
(
)
It works the same as if
operator from JavaScript.
conditionHandler // 1 === 1 conditionHandler // 1 && 2 === 2 conditionHandler // 1 && 0 === 0 conditionHandler // 1 || 0 === 1 conditionHandler // !1 || 0 === 0 conditionHandler // 1 > 2 === false conditionHandler // 2 >= 1 === true
You can use a plugin to handle non-operator argument.
conditionHandler, plugin// obj.test1 && obj.test.field2 === 0
Issues
If you find a bug, please file an issue on GitHub