IsArray

A constraint to check if a value is an array

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

A Simple Example

import {IsArray} from '@schukai/monster/source/constraints/isarray.mjs';

new IsArray()
    .isValid([])
    .then(() => console.log(true));
// ↦ true

new IsArray()
    .isValid(99)
    .catch(e => console.log(e));
// ↦ 99

Exported

IsArray

Derived from

AbstractConstraint

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 AbstractConstraint.

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 AbstractConstraint.

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 AbstractConstraint.

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.