new ArrayNode(key, parent)
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | |
parent |
MixedNode |
- Source:
Extends
Members
-
description
-
Sets the description
- Inherited From:
- Source:
Methods
-
always() → {Condition}
-
- Inherited From:
- Source:
Returns:
- Type
- Condition
-
defaultValue(value) → {MixedNode}
-
Defines the default value for this entity
Parameters:
Name Type Description valuemixed - Inherited From:
- Source:
Returns:
- Type
- MixedNode
-
end() → {MixedNode}
-
Returns the parent context
- Inherited From:
- Source:
Returns:
- Type
- MixedNode
-
hasKey(key) → {ArrayNode}
-
Defines that this array must contain
keyParameters:
Name Type Description keystring - Source:
Returns:
- Type
- ArrayNode
-
ifArray() → {Condition}
-
- Inherited From:
- Source:
Returns:
- Type
- Condition
-
ifInArray() → {Condition}
-
- Inherited From:
- Source:
Returns:
- Type
- Condition
-
ifNotInArray() → {Condition}
-
- Inherited From:
- Source:
Returns:
- Type
- Condition
-
ifNull() → {Condition}
-
- Inherited From:
- Source:
Returns:
- Type
- Condition
-
ifString() → {Condition}
-
- Inherited From:
- Source:
Returns:
- Type
- Condition
-
ifTrue() → {Condition}
-
- Inherited From:
- Source:
Returns:
- Type
- Condition
-
isRequired() → {MixedNode}
-
Mark this entity as required
- Inherited From:
- Source:
Returns:
- Type
- MixedNode
-
lengthOf(value) → {ArrayNode}
-
Defines the required length of this array node
Parameters:
Name Type Description valuenumber - Source:
Returns:
- Type
- ArrayNode
-
maxLength(value) → {ArrayNode}
-
Defines the max length of this array node
Parameters:
Name Type Description valuenumber - Source:
Returns:
- Type
- ArrayNode
-
minLength(value) → {ArrayNode}
-
Defines the min length of this array node
Parameters:
Name Type Description valuenumber - Source:
Returns:
- Type
- ArrayNode
-
nestedObject() → {Context}
-
Returns the current context
- Source:
Returns:
- Type
- Context
-
sanitizer(callback) → {MixedNode}
-
Setup a sanitizer function
Parameters:
Name Type Description callbackfunction - Inherited From:
- Source:
Returns:
- Type
- MixedNode
-
validator(callback) → {MixedNode}
-
Sets the validator function
Parameters:
Name Type Description callbackfunction - Inherited From:
- Source:
Returns:
- Type
- MixedNode
-
validatorIf(condition, validator) → {MixedNode}
-
Sets a conditional validator
Parameters:
Name Type Description conditionfunction validatorfunction - Inherited From:
- Source:
Returns:
- Type
- MixedNode
-
when(condition) → {Condition}
-
Parameters:
Name Type Description conditionfunction - Inherited From:
- Source:
Returns:
- Type
- Condition