OrOperator

A or operator

Import
the javascript logo
import { OrOperator } from "@schukai/monster/source/constraints/oroperator.mjs";
Source
the git logo
Package
the npm logo
Since
1.3.0

A Simple Example

import {Valid} from '@schukai/monster/source/constraints/valid.mjs';
import {Invalid} from '@schukai/monster/source/constraints/invalid.mjs';
import {OrOperator} from '@schukai/monster/source/constraints/oroperator.mjs';

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

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

Exported

OrOperator

Derived from

AbstractOperator

Options

The Options listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Options from these parent classes. If you cannot find a specific Options in this list, we recommend consulting the documentation of the AbstractOperator.

Option
Type
Default
Description
-/-

Properties

The Properties listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Properties from these parent classes. If you cannot find a specific Properties in this list, we recommend consulting the documentation of the AbstractOperator.

Methods

The methods listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits methods from these parent classes. If you cannot find a specific method in this list, we recommend consulting the documentation of the AbstractOperator.

State query methods

isValid(value)
Parameters
  • value {*}: value
Returns
  • {Promise}
this method returns a promise containing the result of the check.

Static methods

[instanceSymbol]()2.1.0
Returns
  • {symbol}
This method is called by the instanceof operator.

Events

This component does not fire any public events. It may fire events that are inherited from its parent classes.

The current width of the area is too small to display the content correctly.