Global

Methods

appRulesValidation(rules, store, appName, component) → {validationsObj}

Pass validation rules per application
Parameters:
Name Type Description
rules Object
store Object application store
appName String smartgut|smartjane|smartflu
component String validation component name
Source:
Returns:
Type
validationsObj

factoryValidationObj(valid, errorType) → {validationObj}

Create a validation object
Parameters:
Name Type Description
valid Boolean
errorType String
Source:
Returns:
Type
validationObj

ruleCreator(description) → {IRulesDescriptor}

Create a rule validator
Parameters:
Name Type Description
description IDescription
Source:
Returns:
Type
IRulesDescriptor

rulesCreator(types, descriptions) → {Object}

Create a set of rules validator
Parameters:
Name Type Description
types Object
descriptions Array.<IDescription>
Source:
Returns:
Type
Object

validate(rules, state, previus) → {validationsObj}

Pass array of rules
Parameters:
Name Type Description
rules Array
state Object
previus Object
Source:
Returns:
Type
validationsObj

Type Definitions

IDescription

Type:
  • Object
Properties:
Name Type Description
type string
name string
stateMap string
compareWith any
defaultValue any
Source:

IRulesDescriptor

Type:
  • Object
Properties:
Name Type Description
errorType string
validate function
Source:

validationObj

Type:
  • Object
Properties:
Name Type Description
valid boolean
error string
Source:

validationsObj

Type:
  • Object
Properties:
Name Type Description
valid boolean
errors Array.<string>
Source: