Class Validator

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(name: string, validatorFn: ValidatorFunction, context?: any): Validator

Parameters

Returns

Validator

Properties

public context: any

public static messageTemplates: any

public name: string

Methods

public static bool(): Validator

Returns

Validator

public static byte(): Validator

Returns

Validator

public static date(): Validator

Returns

Validator

public static duration(): Validator

Returns

Validator

public getMessage(): string

Returns

string

public static guid(): Validator

Returns

Validator

public static int16(): Validator

Returns

Validator

public static int32(): Validator

Returns

Validator

public static int64(): Validator

Returns

Validator

public static maxLength(context: { maxLength: number; }): Validator

Parameters

  • context: { maxLength: number; }

Returns

Validator

public static number(): Validator

Returns

Validator

public static register(validator: Validator)

Parameters

public static registerFactory(fn: () => breeze.Validator, name: string)

Parameters

  • fn: () => breeze.Validator
  • name: string

public static required(): Validator

Returns

Validator

public static string(): Validator

Returns

Validator

public static stringLength(context: { maxLength: number; minLength: number; }): Validator

Parameters

  • context: { maxLength: number; minLength: number; }

Returns

Validator

public validate(value: any, context?: any): ValidationError

Parameters

  • value: any
  • context?: any optional

Returns

ValidationError