References
summary | ||
public |
F unexpectedFiled(filed: *) |
|
public |
F AND(v1: *, v2: *) |
|
public |
F OR(v1: *, v2: *) |
|
public |
F arrayContainsAll(a: *, b: *): boolean |
|
public |
F flattenObject(ob: *): * |
|
public |
F isArray(arr: *) |
|
public |
F isFunction(func: *) |
|
public |
F isInt(val: *) |
|
public |
F isObject(obj: *) |
|
public |
F isString(str: *) |
|
public |
F looseEqual(a: any, b: any): boolean Checks if two bojects are loosly equal |
|
public |
F mapFirstArgument(f: *, map: *): * |
|
public |
F mergeRule(rule1: *, rule2: *, mapFunction: *): {...rule1: Object, ...mappedCopy: Object, "type": *} |
|
public |
Regex that validates if a string is a valid url |
Rule
summary | ||
public |
|
|
public |
C Rule The Rule class validates only one value once a rule is created it can be used multiple times |
|
public |
F getErrorFromFunctionOrString(error: *, path: *, value: *): * |
|
public |
F getErrorFromObject(error: *, path: *, value: *, key: *): * |
Validator
summary | ||
public |
|
|
public |
F getValFromPath(p: *, obj: *): * |
|
public |
F traverse(o: *, fn: *, p: *) |
testFunctions
summary | ||
public |
The optional validation function |
|
public |
V TEST_FUNCTIONS: {...types: Object} |
|
public |
V BOOLEAN: {"type": *, "toBe": *} This object combines all validation functions related to booleans |
|
public |
V NUMBER: {"min": *, "max": *, "equal": *, "type": *} This object combines all validation functions related to numbers |
|
public |
V STRING: {"minLength": *, "maxLength": *, "equal": *, "match": *, "notEmpty": *, "type": *} This object combines all validation functions related to strings |
testFunctions/types
summary | ||
public |
V array: {"of": *, "notEmpty": *, "length": *, "type": *} |
|
public |
|
|
public |
V date: {"after": *, "before": *, "between": *, "equal": *, "type": *} |
|
public |
|
|
public |
|
|
public |
V fn: {"type": *, "result": *} |
|
public |
|
|
public |
|
|
public |
V password: {...STRING: Object, "numbers": *, "uppercase": *, "specialChars": *, "matchesOneOf": *, "matchesAllOf": *} |
|
public |
|
|
public |
|