Header menu logo FCQRS

Validator<'E> Type

Constructors

Constructor Description

Validator(all)

Full Usage: Validator(all)

Parameters:
    all : bool

Returns: Validator<'E>
all : bool
Returns: Validator<'E>

Instance members

Instance member Description

this.DefaultOfError

Full Usage: this.DefaultOfError

Parameters:
Returns: FieldInfo<'T, 'T0, 'E>

Defaults of Error value, it won't collect error

defaults : 'T0
input : FieldInfo<'T, Result<'T0, 'TError>, 'E>
Returns: FieldInfo<'T, 'T0, 'E>

this.DefaultOfNone

Full Usage: this.DefaultOfNone

Parameters:
    defaults : 'T0
    input : FieldInfo<'T, 'T0 option, 'E>

Returns: FieldInfo<'T, 'T0, 'E>

Defaults of None value, it won't collect error

defaults : 'T0
input : FieldInfo<'T, 'T0 option, 'E>
Returns: FieldInfo<'T, 'T0, 'E>

this.End

Full Usage: this.End

Parameters:
Returns: 'T0
input : FieldInfo<'T, 'T0, 'E>
Returns: 'T0

this.EndAsync

Full Usage: this.EndAsync

Parameters:
Returns: Async<'T0>
input : Async<FieldInfo<'T, 'T0, 'E>>
Returns: Async<'T0>

this.Enum

Full Usage: this.Enum

Parameters:
    enums : 'T0 list

Returns: 'E -> FieldInfo<'T, 'T0, 'E> -> FieldInfo<'T, 'T0, 'E>
enums : 'T0 list
Returns: 'E -> FieldInfo<'T, 'T0, 'E> -> FieldInfo<'T, 'T0, 'E>

this.Errors

Full Usage: this.Errors

Returns: Map<string, 'E list>
Returns: Map<string, 'E list>

this.Gt

Full Usage: this.Gt

Parameters:
    min : 'a
    err : 'E

Returns: FieldInfo<'a0, 'a, 'E> -> FieldInfo<'a0, 'a, 'E>

Greater then a value, if err is a string, it can contains `{min}` to reuse first param

min : 'a
err : 'E
Returns: FieldInfo<'a0, 'a, 'E> -> FieldInfo<'a0, 'a, 'E>

this.Gte

Full Usage: this.Gte

Parameters:
    min : 'a
    err : 'E

Returns: FieldInfo<'a0, 'a, 'E> -> FieldInfo<'a0, 'a, 'E>

Greater and equal then a value, if err is a string, it can contains `{min}` to reuse first param

min : 'a
err : 'E
Returns: FieldInfo<'a0, 'a, 'E> -> FieldInfo<'a0, 'a, 'E>

this.HasError

Full Usage: this.HasError

Returns: bool
Returns: bool

this.IsDegist

Full Usage: this.IsDegist

Parameters:
    error : 'E
    input : FieldInfo<'T, string, 'E>

Returns: FieldInfo<'T, string, 'E>
error : 'E
input : FieldInfo<'T, string, 'E>
Returns: FieldInfo<'T, string, 'E>

this.IsMail

Full Usage: this.IsMail

Parameters:
    error : 'E
    input : FieldInfo<'T, string, 'E>

Returns: FieldInfo<'T, string, 'E>
error : 'E
input : FieldInfo<'T, string, 'E>
Returns: FieldInfo<'T, string, 'E>

this.IsOk

Full Usage: this.IsOk

Parameters:
    error : 'E

Returns: FieldInfo<'T, Result<'T0, 'TError>, 'E> -> FieldInfo<'T, 'T0, 'E>

Test a Result value is Ok and unwrap it it will collect error

error : 'E
Returns: FieldInfo<'T, Result<'T0, 'TError>, 'E> -> FieldInfo<'T, 'T0, 'E>

this.IsSome

Full Usage: this.IsSome

Parameters:
    error : 'E

Returns: FieldInfo<'T, 'T0 option, 'E> -> FieldInfo<'T, 'T0, 'E>

Test an option value is some and unwrap it it will collect error

error : 'E
Returns: FieldInfo<'T, 'T0 option, 'E> -> FieldInfo<'T, 'T0, 'E>

this.IsUrl

Full Usage: this.IsUrl

Parameters:
    error : 'E
    input : FieldInfo<'T, string, 'E>

Returns: FieldInfo<'T, string, 'E>
error : 'E
input : FieldInfo<'T, string, 'E>
Returns: FieldInfo<'T, string, 'E>

this.IsValid

Full Usage: this.IsValid

Parameters:
    tester : 'T0 -> bool

Returns: 'E -> FieldInfo<'T, 'T0, 'E> -> FieldInfo<'T, 'T0, 'E>

Validate with a custom tester, return bool

tester : 'T0 -> bool
Returns: 'E -> FieldInfo<'T, 'T0, 'E> -> FieldInfo<'T, 'T0, 'E>

this.IsValidAsync

Full Usage: this.IsValidAsync

Parameters:
    tester : 'T0 -> Async<bool>

Returns: 'E -> Async<FieldInfo<'T, 'T0, 'E>> -> Async<FieldInfo<'T, 'T0, 'E>>
tester : 'T0 -> Async<bool>
Returns: 'E -> Async<FieldInfo<'T, 'T0, 'E>> -> Async<FieldInfo<'T, 'T0, 'E>>

this.IsValidOpt

Full Usage: this.IsValidOpt

Parameters:
Returns: FieldInfo<'T, 'T1, 'E>

Validate with a custom tester, return ValidateResult DU to modify input value

tester : 'T0 -> ValidateResult<'T1>
error : 'E
input : FieldInfo<'T, 'T0, 'E>
Returns: FieldInfo<'T, 'T1, 'E>

this.IsValidOptAsync

Full Usage: this.IsValidOptAsync

Parameters:
Returns: Async<FieldInfo<'T, 'T1, 'E>>
tester : 'T0 -> Async<ValidateResult<'T1>>
error : 'E
input : Async<FieldInfo<'T, 'T0, 'E>>
Returns: Async<FieldInfo<'T, 'T1, 'E>>

this.Lt

Full Usage: this.Lt

Parameters:
    max : 'a
    err : 'E

Returns: FieldInfo<'a0, 'a, 'E> -> FieldInfo<'a0, 'a, 'E>

Less then a value, if err is a string, it can contains `{max}` to reuse first param

max : 'a
err : 'E
Returns: FieldInfo<'a0, 'a, 'E> -> FieldInfo<'a0, 'a, 'E>

this.Lte

Full Usage: this.Lte

Parameters:
    max : 'a
    err : 'E

Returns: FieldInfo<'a0, 'a, 'E> -> FieldInfo<'a0, 'a, 'E>

Less and equal then a value, if err is a string, it can contains `{max}` to reuse first param

max : 'a
err : 'E
Returns: FieldInfo<'a0, 'a, 'E> -> FieldInfo<'a0, 'a, 'E>

this.Map

Full Usage: this.Map

Parameters:
    fn : 'T0 -> 'T1

Returns: FieldInfo<'T, 'T0, 'E> -> FieldInfo<'T, 'T1, 'E>

Map a function or constructor to the value, aka lift fn shouldn't throw error, if it would, please using `t.To fn error`

fn : 'T0 -> 'T1
Returns: FieldInfo<'T, 'T0, 'E> -> FieldInfo<'T, 'T1, 'E>

this.Match

Full Usage: this.Match

Parameters:
Returns: FieldInfo<'T, string, 'E>
regex : Regex
error : 'E
input : FieldInfo<'T, string, 'E>
Returns: FieldInfo<'T, string, 'E>

this.MaxLen

Full Usage: this.MaxLen

Parameters:
    len : int
    err : 'E
    input : FieldInfo<'T, 'T0, 'E>

Returns: FieldInfo<'T, 'T0, 'E>

Max length, if err is a string, it can contains `{len}` to reuse first param

len : int
err : 'E
input : FieldInfo<'T, 'T0, 'E>
Returns: FieldInfo<'T, 'T0, 'E>

this.MinLen

Full Usage: this.MinLen

Parameters:
    len : int
    err : 'E
    input : FieldInfo<'T, 'T0, 'E>

Returns: FieldInfo<'T, 'T0, 'E>

Min length, if err is a string, it can contains `{len}` to reuse first param

len : int
err : 'E
input : FieldInfo<'T, 'T0, 'E>
Returns: FieldInfo<'T, 'T0, 'E>

this.NotBlank

Full Usage: this.NotBlank

Parameters:
    err : 'E

Returns: FieldInfo<'T, string, 'E> -> FieldInfo<'T, string, 'E>

Validate with `String.IsNullOrWhiteSpace`

err : 'E
Returns: FieldInfo<'T, string, 'E> -> FieldInfo<'T, string, 'E>

this.PushError

Full Usage: this.PushError

Parameters:
    name : string
    error : 'E

name : string
error : 'E

this.Test

Full Usage: this.Test

Parameters:
    name : string
    value : 'T

Returns: FieldInfo<'T, 'T, 'E>
name : string
value : 'T
Returns: FieldInfo<'T, 'T, 'E>

this.TestAsync

Full Usage: this.TestAsync

Parameters:
    name : string
    value : 'T

Returns: Async<FieldInfo<'T, 'T, 'E>>
Modifiers: inline
name : string
value : 'T
Returns: Async<FieldInfo<'T, 'T, 'E>>

this.TestOne

Full Usage: this.TestOne

Parameters:
    value : 'T

Returns: FieldInfo<'T, 'T, 'E>
Modifiers: inline
value : 'T
Returns: FieldInfo<'T, 'T, 'E>

this.TestOneOnlyOk

Full Usage: this.TestOneOnlyOk

Parameters:
Returns: (FieldInfo<'T, 'T, 'E> -> FieldInfo<'T, 'T, 'E>) list -> Result<'T, 'TError>
Modifiers: inline
Type parameters: 'TError
value : Result<'T, 'TError>
Returns: (FieldInfo<'T, 'T, 'E> -> FieldInfo<'T, 'T, 'E>) list -> Result<'T, 'TError>

this.TestOneOnlyOkAsync

Full Usage: this.TestOneOnlyOkAsync

Parameters:
Returns: (Async<FieldInfo<'T, 'T, 'E>> -> Async<FieldInfo<'T, 'T, 'E>>) list -> Async<Result<'T, 'TError>>
Modifiers: inline
Type parameters: 'TError
value : Result<'T, 'TError>
Returns: (Async<FieldInfo<'T, 'T, 'E>> -> Async<FieldInfo<'T, 'T, 'E>>) list -> Async<Result<'T, 'TError>>

this.TestOneOnlySome

Full Usage: this.TestOneOnlySome

Parameters:
    value : 'T option

Returns: (FieldInfo<'T, 'T, 'E> -> FieldInfo<'T, 'T, 'E>) list -> 'T option
Modifiers: inline
value : 'T option
Returns: (FieldInfo<'T, 'T, 'E> -> FieldInfo<'T, 'T, 'E>) list -> 'T option

this.TestOneOnlySomeAsync

Full Usage: this.TestOneOnlySomeAsync

Parameters:
    value : 'T option

Returns: (Async<FieldInfo<'T, 'T, 'E>> -> Async<FieldInfo<'T, 'T, 'E>>) list -> Async<'T option>
Modifiers: inline
value : 'T option
Returns: (Async<FieldInfo<'T, 'T, 'E>> -> Async<FieldInfo<'T, 'T, 'E>>) list -> Async<'T option>

this.TestOnlyOk

Full Usage: this.TestOnlyOk

Parameters:
Returns: Result<'T, 'TError>

Test rules only if value is Ok, it won't collect error if value is Error

name : string
value : Result<'T, 'TError>
rules : (FieldInfo<'T, 'T, 'E> -> FieldInfo<'T, 'T, 'E>) list
Returns: Result<'T, 'TError>

this.TestOnlyOkAsync

Full Usage: this.TestOnlyOkAsync

Parameters:
Returns: Async<Result<'T, 'TError>>

Test rules only if value is Ok, it won't collect error if value is Error

name : string
value : Result<'T, 'TError>
rules : (Async<FieldInfo<'T, 'T, 'E>> -> Async<FieldInfo<'T, 'T, 'E>>) list
Returns: Async<Result<'T, 'TError>>

this.TestOnlySome

Full Usage: this.TestOnlySome

Parameters:
    name : string
    value : 'T option
    rules : (FieldInfo<'T, 'T, 'E> -> FieldInfo<'T, 'T, 'E>) list

Returns: 'T option

Test rules only if value is Some, it won't collect error if value is None

name : string
value : 'T option
rules : (FieldInfo<'T, 'T, 'E> -> FieldInfo<'T, 'T, 'E>) list
Returns: 'T option

this.TestOnlySomeAsync

Full Usage: this.TestOnlySomeAsync

Parameters:
Returns: Async<'T option>

Test rules only if value is Some, it won't collect error if value is None

name : string
value : 'T option
rules : (Async<FieldInfo<'T, 'T, 'E>> -> Async<FieldInfo<'T, 'T, 'E>>) list
Returns: Async<'T option>

this.To

Full Usage: this.To

Parameters:
    fn : 'T0 -> 'T1

Returns: 'E -> FieldInfo<'T, 'T0, 'E> -> FieldInfo<'T, 'T1, 'E>

Convert the input value by fn if fn throws error then it will collect error

fn : 'T0 -> 'T1
Returns: 'E -> FieldInfo<'T, 'T0, 'E> -> FieldInfo<'T, 'T1, 'E>

this.ToAsync

Full Usage: this.ToAsync

Parameters:
Returns: Async<FieldInfo<'T, 'T0, 'E>>

Convert a synchronize validate pipe to asynchronize

input : FieldInfo<'T, 'T0, 'E>
Returns: Async<FieldInfo<'T, 'T0, 'E>>

this.Trim

Full Usage: this.Trim

Parameters:
Returns: FieldInfo<'T, string, string>
input : FieldInfo<'T, string, string>
Returns: FieldInfo<'T, string, string>

Type something to start searching.