Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.

Latest commit

 

History

History
96 lines (80 loc) · 7.21 KB

File metadata and controls

96 lines (80 loc) · 7.21 KB

docs » cp.rx.go.Require


A Statement that will require that the resolvable value matches a predicate, and if not, it will send an error.

Submodules

API Overview

  • Constants - Useful values which cannot be changed
  • OrThrow
  • Functions - API calls offered directly by the extension
  • Require
  • Methods - API calls which can only be made on an object returned by a constructor
  • Are
  • AreNot
  • Is
  • IsNot
  • Matches
  • OrThrow

API Documentation

Constants

Signature cp.rx.go.Require.OrThrow <cp.rx.go.Statement.Modifier>
Type Constant
Description A Statement.Modifier that sets the message to throw if the requirement is not met.

Functions

Signature cp.rx.go.Require(requirement) -> Require
Type Function
Description Creates a new Require Statement with the specified requirement.
Parameters
  • requirement - a resolvable value that will be checked.
Returns
  • The Statement instance which will check if the requirement matches the requirement.

Methods

Signature cp.rx.go.Require:Are(value) -> Require.Are
Type Method
Description Specifies the value to check.
Parameters
  • value - The value that all results from the requirement must match.
Returns
  • The Are Statement.Modifier.
Signature cp.rx.go.Require:AreNot(value) -> Require.AreNot
Type Method
Description Specifies the value to check.
Parameters
  • value - The value that all results from the requirement must match.
Returns
  • The AreNot Statement.Modifier.
Signature cp.rx.go.Require:Is(value) -> Require.Is
Type Method
Description Specifies the value to check.
Parameters
  • value - The value that all results from the requirement must match.
Returns
  • The Is Statement.Modifier.
Signature cp.rx.go.Require:IsNot(value) -> Require.IsNot
Type Method
Description Specifies the value to check.
Parameters
  • value - The value that all results from the requirement must not match.
Returns
  • The IsNot Statement.Modifier.
Signature cp.rx.go.Require:Matches(predicate) -> Require.Matches
Type Method
Description Specifies the predicate to check.
Parameters
  • value - The value that all results from the requirement must not match.
Returns
  • The Matches Statement.Modifier.
Signature cp.rx.go.Require:OrThrow(message) -> Require.OrThrow
Type Method
Description Specifies the message to throw if the requirement is not met.
Parameters
  • message - The string to throw when there is an error.
Returns
  • The OrThrow Statement.Modifier.