Refactored ArrayGet instruction and added documentation for the instruction.
This commit is contained in:
parent
7ff6dda8e0
commit
c01ad0d6d9
2 changed files with 58 additions and 8 deletions
39
docs/array_get.md
Normal file
39
docs/array_get.md
Normal file
|
@ -0,0 +1,39 @@
|
|||
# array_get
|
||||
|
||||
Get an item from an array using "dot" notation.
|
||||
|
||||
## Parameters
|
||||
|
||||
* array (`array`, `instruction`) - The array to get the value from.
|
||||
* key (`string`, `instruction`) - The key to get the value for.
|
||||
|
||||
## Return
|
||||
|
||||
(mixed) - The value of the key or throws an exception if the key is not found.
|
||||
|
||||
## Exceptions
|
||||
|
||||
* `EvaluationException` - If there was an error while evaluating one or more parameters.
|
||||
* `KeyException` - If the key is not found.
|
||||
* `TypeException` - If one or more parameters are not of the expected type.
|
||||
|
||||
## Instruction Example
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "array_get",
|
||||
"_": {
|
||||
"array": {
|
||||
"foo": {
|
||||
"bar": "baz"
|
||||
}
|
||||
},
|
||||
"key": "foo.bar"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Last Updated
|
||||
|
||||
Monday, December 26th, 2022.
|
||||
Written by [Netkas](https://git.n64.cc/netkas)
|
Loading…
Add table
Add a link
Reference in a new issue