Valid

Monster/Constraints. Valid

The valid constraint allows an always valid query to be performed. this constraint is mainly intended for testing.

You can call the method via the monster namespace new Monster.Constraint.Valid().

<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/valid.js';
new Monster.Constraint.Valid();
</script>

Alternatively, you can also integrate this function individually.

<script type="module">
import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/valid.js';
new Valid();
</script>

Constructor

# new Valid()

Since:
  • 1.3.0
Example
import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.8.0/dist/modules/constraints/valid.js';

new Valid().isValid()
.then(()=>console.log(true))
.catch(()=>console.log(false));
// ↦ true

Methods

# isValid(value) → {Promise}

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

Parameters:
Name Type Description
value *
Returns:
Type
Promise