Monster.Constraints. Invalid

Constraints are used to define conditions that must be met by the value of a variable.

The uniform API of the constraints allows chains to be formed.

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

Constructor

new Invalid()

A constraint that always invalid

Since
  • 1.3.0
License
  • AGPLv3
Example
import {Invalid} from '@schukai/monster/source/constraints/invalid.mjs';

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

Methods

isValid(value) → {Promise}

this method return a rejected promise

.

this method return a rejected promise

Parameters:
NameTypeDescription
value*
Returns:
Type: 
Promise