Home Reference Source
import Result from 'fence.js/src/lib/Result.js'
public class | source

Result

Adapter for mapping validation invokables to their results

Constructor Summary

Public Constructor
public

constructor(invokables: Invokable[], results: Result[])

Member Summary

Private Members
private
private
private

Method Summary

Public Methods
public

explain(logger: *, indent: *)

public

forAll(): Boolean

A Results summary that will return true if all validations passed

public

forAny(): Boolean

A Results summary that will return true if any validations passed

public

forOne(name: String): Array

Filters results by name

Public Constructors

public constructor(invokables: Invokable[], results: Result[]) source

Params:

NameTypeAttributeDescription
invokables Invokable[]

Array of invokable validation functions

results Result[]

Array of values returned from invoked validation functions

Private Members

private _invokables: * source

private _results: * source

private _subject: * source

Public Methods

public explain(logger: *, indent: *) source

Params:

NameTypeAttributeDescription
logger *
indent *

public forAll(): Boolean source

A Results summary that will return true if all validations passed

Return:

Boolean

true if all Results are also true, false otherwise

public forAny(): Boolean source

A Results summary that will return true if any validations passed

Return:

Boolean

true if any one Result is also true, false if all results are also false

public forOne(name: String): Array source

Filters results by name

Params:

NameTypeAttributeDescription
name String

The name for a specific Invokable. This value is set by FenceBuilder.register

Return:

Array

An array of Booleans derived from specified Invokables