new CdtContext()
Nested CDT context type.
- Source:
- Since:
- v3.12.0
- See:
-
ListOperation#withContext
Adding context to list operationsMap#Operation#withContext
Adding context to map operations
Methods
addListIndex(index) → {CdtContext}
Lookup list by index offset.
- Description:
If the index is negative, the resolved index starts backwards from end of list. If an index is out of bounds, a parameter error will be returned. Examples:
- 0: First item.
- 4: Fifth item.
- -1: Last item.
- -3: Third to last item.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
index |
number | List index |
Returns:
Updated CDT context, so calls can be chained.
- Type
- CdtContext
addListIndexCreate(index, order, pad) → {CdtContext}
Lookup list by base list's index offset.
- Description:
If the list at index offset is not found, create it with the given sort order at that index offset. If pad is true and the index offset is greater than the bounds of the base list, nil entries will be inserted before the newly created list.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
index |
number | List index |
order |
number | Sort order used if a list is created |
pad |
boolean | Pads list entries between index and the final list entry with zeros. |
Returns:
Updated CDT context, so calls can be chained.
- Type
- CdtContext
addListRank(rank) → {CdtContext}
Lookup list by rank.
- Description:
Examples:
- 0 = smallest value
- N = Nth smallest value
- -1 = largest value
- Source:
Parameters:
Name | Type | Description |
---|---|---|
rank |
number | List rank |
Returns:
Updated CDT context, so calls can be chained.
- Type
- CdtContext
addListValue(value) → {CdtContext}
Lookup list by value.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
value |
any | List value |
Returns:
Updated CDT context, so calls can be chained.
- Type
- CdtContext
addMapIndex(index) → {CdtContext}
Lookup map by index offset.
- Description:
If the index is negative, the resolved index starts backwards from end of list. If an index is out of bounds, a parameter error will be returned. Examples:
- 0: First item.
- 4: Fifth item.
- -1: Last item.
- -3: Third to last item.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
index |
number | Map index |
Returns:
Updated CDT context, so calls can be chained.
- Type
- CdtContext
addMapKey(key) → {CdtContext}
Lookup map by key.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
key |
any | Map key |
Returns:
Updated CDT context, so calls can be chained.
- Type
- CdtContext
addMapKeyCreate(key, order) → {CdtContext}
Lookup map by base map's key. If the map at key is not found, create it with the given sort order at that key.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
key |
any | Map key |
order |
number | Sort order used if a map is created |
Returns:
Updated CDT context, so calls can be chained.
- Type
- CdtContext
addMapRank(rank) → {CdtContext}
Lookup map by rank.
- Description:
Examples:
- 0 = smallest value
- N = Nth smallest value
- -1 = largest value
- Source:
Parameters:
Name | Type | Description |
---|---|---|
rank |
number | Map rank |
Returns:
Updated CDT context, so calls can be chained.
- Type
- CdtContext
addMapValue(value) → {CdtContext}
Lookup map by value.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
value |
any | Map value |
Returns:
Updated CDT context, so calls can be chained.
- Type
- CdtContext
(static) getContextType(ctx,, type,) → {number}
- Description:
Retrieve expression type list/map from ctx or from type.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
ctx, |
CdtContext | ctx value object. |
type, |
number |
|
Returns:
exp.type
expression type.
- Type
- number