AndOperator

AndOperator

The AndOperator is used to link several contraints. The constraint is fulfilled if all constraints of the operators are fulfilled.

<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.2.1/dist/modules/constraint/andoperator.js';
new Monster.Constraint.AndOperator(new Monster.Constraint.Valid(), new Monster.Constraint.Valid()).then(()=>console.log(true)).catch(()=>console.log(false));
</script>

Alternatively, you can also integrate this function individually.

<script type="module">
import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.2.1/dist/modules/constraint/valid.js';
import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.2.1/dist/modules/constraint/andoperator.js';
new AndOperator(new Valid(), new Valid()).then(()=>console.log(true)).catch(()=>console.log(false));
</script>

Constructor

new AndOperator()

Source:
Since:
  • 1.3.0

Methods

isValid(value) → {Promise}

Source:

this method return a promise containing the result of the check.

Parameters:
Name Type Description
value *
Returns:
Type
Promise