Added dict functions 'getDictKeys', 'getDictValues' and dict methods 'getKeys', 'getValues'

commit_hash:72a3403d64b815229331e2c8a116c9ac97b04bdf
This commit is contained in:
denlvovich
2025-07-15 23:44:34 +03:00
parent 3abf65e608
commit 1d9e71255a
8 changed files with 330 additions and 13 deletions
@@ -781,6 +781,34 @@
"platforms": [
"ios"
]
},
{
"function_name": "getDictKeys",
"doc": "Return a collection containing just the keys of the dictionary.",
"arguments": [
{
"type": "dict",
"doc": "Dictionary."
}
],
"result_type": "array",
"platforms": [
"ios"
]
},
{
"function_name": "getDictValues",
"doc": "Return a collection containing just the values of the dictionary.",
"arguments": [
{
"type": "dict",
"doc": "Dictionary."
}
],
"result_type": "array",
"platforms": [
"ios"
]
}
]
}
@@ -1520,6 +1520,108 @@
"platforms": [
"ios"
]
},
{
"expression": "@{getDictKeys(source)}",
"expected": {
"type": "unordered_array",
"value": [
"key3",
"key1",
"key2"
]
},
"variables": [
{
"type": "dict",
"name": "source",
"value": {
"key1": {
"name": "text1"
},
"key2": {
"name": "text2"
},
"key3": {
"name": "text3"
}
}
}
],
"platforms": [
"ios"
]
},
{
"expression": "@{getDictKeys(source)}",
"expected": {
"type": "unordered_array",
"value": []
},
"variables": [
{
"type": "dict",
"name": "source",
"value": {}
}
],
"platforms": [
"ios"
]
},
{
"expression": "@{getDictValues(source)}",
"expected": {
"type": "unordered_array",
"value": [
{
"name": "text2"
},
{
"name": "text1"
},
{
"name": "text2"
}
]
},
"variables": [
{
"type": "dict",
"name": "source",
"value": {
"key1": {
"name": "text1"
},
"key2": {
"name": "text2"
},
"key3": {
"name": "text2"
}
}
}
],
"platforms": [
"ios"
]
},
{
"expression": "@{getDictValues(source)}",
"expected": {
"type": "unordered_array",
"value": []
},
"variables": [
{
"type": "dict",
"name": "source",
"value": {}
}
],
"platforms": [
"ios"
]
}
]
}
@@ -535,6 +535,108 @@
"web",
"flutter"
]
},
{
"expression": "@{dict_var.getKeys()}",
"expected": {
"type": "unordered_array",
"value": []
},
"variables": [
{
"name": "dict_var",
"type": "dict",
"value": {}
}
],
"platforms": [
"ios"
]
},
{
"expression": "@{dict_var.getKeys()}",
"expected": {
"type": "unordered_array",
"value": [
"key3",
"key1",
"key2"
]
},
"variables": [
{
"type": "dict",
"name": "dict_var",
"value": {
"key1": {
"name": "text1"
},
"key2": {
"name": "text2"
},
"key3": {
"name": "text3"
}
}
}
],
"platforms": [
"ios"
]
},
{
"expression": "@{dict_var.getValues()}",
"expected": {
"type": "unordered_array",
"value": []
},
"variables": [
{
"name": "dict_var",
"type": "dict",
"value": {}
}
],
"platforms": [
"ios"
]
},
{
"expression": "@{dict_var.getValues()}",
"expected": {
"type": "unordered_array",
"value": [
{
"name": "text2"
},
{
"name": "text1"
},
{
"name": "text2"
}
]
},
"variables": [
{
"type": "dict",
"name": "dict_var",
"value": {
"key1": {
"name": "text1"
},
"key2": {
"name": "text2"
},
"key3": {
"name": "text2"
}
}
}
],
"platforms": [
"ios"
]
}
]
}
@@ -223,6 +223,36 @@
"web",
"flutter"
]
},
{
"function_name": "getKeys",
"is_method": true,
"doc": "Return a collection containing just the keys of the dictionary.",
"arguments": [
{
"type": "dict",
"doc": "Dictionary."
}
],
"result_type": "array",
"platforms": [
"ios"
]
},
{
"function_name": "getValues",
"is_method": true,
"doc": "Return a collection containing just the values of the dictionary.",
"arguments": [
{
"type": "dict",
"doc": "Dictionary."
}
],
"result_type": "array",
"platforms": [
"ios"
]
}
]
}