Skip to content

Commit ec4483a

Browse files
committedAug 24, 2018
Update map and array examples
1 parent 7e63093 commit ec4483a

20 files changed

+31
-31
lines changed
 

‎resources/function_help/json/array

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
{"arg":"value1", "syntaxOnly": true},
88
{"arg":"value2", "syntaxOnly": true},
99
{"arg":"value", "descOnly": true, "description":"a value"}],
10-
"examples": [ { "expression":"array(2,10)", "returns":"array: 2, 10"}
10+
"examples": [ { "expression":"array(2,10)", "returns":"[ 2, 10 ]"}
1111
]
1212
}

‎resources/function_help/json/array_append

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"description": "Returns an array with the given value added at the end.",
55
"arguments": [ {"arg":"array","description":"an array"},
66
{"arg":"value","description":"the value to add"}],
7-
"examples": [ { "expression":"array_append(array(1,2,3),4)", "returns":"array: 1,2,3,4"}]
7+
"examples": [ { "expression":"array_append(array(1,2,3),4)", "returns":"[ 1, 2, 3, 4 ]"}]
88
}

‎resources/function_help/json/array_cat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
{"arg":"array1", "syntaxOnly": true},
88
{"arg":"array2", "syntaxOnly": true},
99
{"arg":"array", "descOnly": true, "description":"an array"}],
10-
"examples": [ { "expression":"array_cat(array(1,2),array(2,3))", "returns":"array: 1,2,2,3"}
10+
"examples": [ { "expression":"array_cat(array(1,2),array(2,3))", "returns":"[ 1, 2, 2, 3 ]"}
1111
]
1212
}

‎resources/function_help/json/array_distinct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"description": "Returns an array containing distinct values of the given array.",
55
"arguments": [
66
{"arg":"array","description":"an array"}],
7-
"examples": [ { "expression":"array_distinct(array(1,2,3,2,1))", "returns":"array: 1,2,3"}
7+
"examples": [ { "expression":"array_distinct(array(1,2,3,2,1))", "returns":"[ 1, 2, 3 ]"}
88
]
99
}

‎resources/function_help/json/array_foreach

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{"arg":"expression","description":"an expression to evaluate on each item. The variable `@element` will be replaced by the current value."}
88
],
99
"examples": [
10-
{ "expression": "array_foreach(array('a','b','c'),upper(@element))", "returns":"array: 'A', 'B', 'C'"},
11-
{ "expression": "array_foreach(array(1,2,3),@element + 10)", "returns":"array: 11, 12, 13"}
10+
{ "expression": "array_foreach(array('a','b','c'),upper(@element))", "returns":"[ 'A', 'B', 'C' ]"},
11+
{ "expression": "array_foreach(array(1,2,3),@element + 10)", "returns":"[ 11, 12, 13 ]"}
1212
]
1313
}

‎resources/function_help/json/array_insert

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"arguments": [ {"arg":"array","description":"an array"},
66
{"arg":"pos","description":"the position where to add (0 based)"},
77
{"arg":"value","description":"the value to add"}],
8-
"examples": [ { "expression":"array_insert(array(1,2,3),1,100)", "returns":"array: 1,100,2,3"}]
8+
"examples": [ { "expression":"array_insert(array(1,2,3),1,100)", "returns":"[ 1, 100, 2, 3 ]"}]
99
}

‎resources/function_help/json/array_prepend

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"description": "Returns an array with the given value added at the beginning.",
55
"arguments": [ {"arg":"array","description":"an array"},
66
{"arg":"value","description":"the value to add"}],
7-
"examples": [ { "expression":"array_prepend(array(1,2,3),0)", "returns":"array: 0,1,2,3"}]
7+
"examples": [ { "expression":"array_prepend(array(1,2,3),0)", "returns":"[ 0, 1, 2, 3 ]"}]
88
}

‎resources/function_help/json/array_remove_all

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"description": "Returns an array with all the entries of the given value removed.",
55
"arguments": [ {"arg":"array","description":"an array"},
66
{"arg":"value","description":"the values to remove"}],
7-
"examples": [ { "expression":"array_remove_all(array('a','b','c','b'),'b')", "returns":"array: 'a','c'"}]
7+
"examples": [ { "expression":"array_remove_all(array('a','b','c','b'),'b')", "returns":"[ 'a', 'c' ]"}]
88
}

‎resources/function_help/json/array_remove_at

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"description": "Returns an array with the given index removed.",
55
"arguments": [ {"arg":"array","description":"an array"},
66
{"arg":"pos","description":"the position to remove (0 based)"}],
7-
"examples": [ { "expression":"array_remove_at(array(1,2,3),1)", "returns":"array: 1,3"}]
7+
"examples": [ { "expression":"array_remove_at(array(1,2,3),1)", "returns":"[ 1, 3 ]"}]
88
}

‎resources/function_help/json/array_reverse

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"type": "function",
44
"description": "Returns the given array with array values in reversed order.",
55
"arguments": [ {"arg":"array","description":"an array"} ],
6-
"examples": [ { "expression":"array_reverse(array(2,4,0,10))", "returns":"array: 10,0,4,2"}]
6+
"examples": [ { "expression":"array_reverse(array(2,4,0,10))", "returns":"[ 10, 0, 4, 2 ]"}]
77
}

‎resources/function_help/json/array_slice

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,35 @@
1717
],
1818
"examples": [{
1919
"expression": "array_slice(array(1,2,3,4,5),0,3)",
20-
"returns": "array: 1,2,3,4"
20+
"returns": "[ 1, 2, 3, 4 ]"
2121
},
2222
{
2323
"expression": "array_slice(array(1,2,3,4,5),0,-1)",
24-
"returns": "array: 1,2,3,4,5"
24+
"returns": "[ 1, 2, 3, 4, 5 ]"
2525
},
2626
{
2727
"expression": "array_slice(array(1,2,3,4,5),-5,-1)",
28-
"returns": "array: 1,2,3,4,5"
28+
"returns": "[ 1, 2, 3, 4, 5 ]"
2929
},
3030
{
3131
"expression": "array_slice(array(1,2,3,4,5),0,0)",
32-
"returns": "array: 1"
32+
"returns": "[ 1 ]"
3333
},
3434
{
3535
"expression": "array_slice(array(1,2,3,4,5),-2,-1)",
36-
"returns": "array: 4,5"
36+
"returns": "[ 4, 5 ]"
3737
},
3838
{
3939
"expression": "array_slice(array(1,2,3,4,5),-1,-1)",
40-
"returns": "array: 5"
40+
"returns": "[ 5 ]"
4141
},
4242
{
4343
"expression": "array_slice(array('Dufour','Valmiera','Chugiak','Brighton'),1,2)",
44-
"returns": "array: 'Valmiera','Chugiak'"
44+
"returns": "[ 'Valmiera', 'Chugiak' ]"
4545
},
4646
{
4747
"expression": "array_slice(array_slice(array('Dufour','Valmiera','Chugiak','Brighton'),-2,-1)",
48-
"returns": "array: 'Chugiak','Brighton'"
48+
"returns": "[ 'Chugiak', 'Brighton' ]"
4949
}
5050
]
5151
}

‎resources/function_help/json/generate_series

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{"arg":"stop", "description":"value that ends the sequence once reached"},
88
{"arg":"step","optional":true,"default":"1","description":"value used as the increment between values"}
99
],
10-
"examples": [ { "expression":"generate_series('1,5)", "returns":"array: '1', '2', '3', '4', '5'"},
11-
{ "expression":"generate_series('5,1,-1)", "returns":"array: '5', '4', '3', '2', '1'"}
10+
"examples": [ { "expression":"generate_series('1,5)", "returns":"[ 1, 2, 3, 4, 5 ]"},
11+
{ "expression":"generate_series('5,1,-1)", "returns":"[ 5, 4, 3, 2, 1 ]"}
1212
]
1313
}

‎resources/function_help/json/map

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
{"arg":"value2", "syntaxOnly": true},
1111
{"arg":"key", "descOnly": true, "description":"a key (string)"},
1212
{"arg":"value", "descOnly": true, "description":"a value"}],
13-
"examples": [ { "expression":"map('1','one','2', 'two')", "returns":"map: 1: 'one', 2: 'two'"}
13+
"examples": [ { "expression":"map('1','one','2', 'two')", "returns":"{ '1': 'one', '2': 'two' }"}
1414
]
1515
}

‎resources/function_help/json/map_akeys

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"type": "function",
44
"description": "Returns all the keys of a map as an array.",
55
"arguments": [ {"arg":"map","description":"a map"}],
6-
"examples": [ { "expression":"map_akeys(map('1','one','2','two'))", "returns":"array: '1', '2'"}]
6+
"examples": [ { "expression":"map_akeys(map('1','one','2','two'))", "returns":"[ '1', '2' ]"}]
77
}

‎resources/function_help/json/map_avals

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"type": "function",
44
"description": "Returns all the values of a map as an array.",
55
"arguments": [ {"arg":"map","description":"a map"}],
6-
"examples": [ { "expression":"map_avals(map('1','one','2','two'))", "returns":"array: 'one', 'two'"}]
6+
"examples": [ { "expression":"map_avals(map('1','one','2','two'))", "returns":"[ 'one', 'two' ]"}]
77
}

‎resources/function_help/json/map_concat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
{"arg":"map1", "syntaxOnly": true},
88
{"arg":"map2", "syntaxOnly": true},
99
{"arg":"map", "descOnly": true, "description":"a map"}],
10-
"examples": [ { "expression":"map_concat(map('1','one', '2','overridden'),map('2','two', '3','three'))", "returns":"map: 1: 'one, 2: 'two', 3: 'three'"}
10+
"examples": [ { "expression":"map_concat(map('1','one', '2','overridden'),map('2','two', '3','three'))", "returns":"{ '1': 'one, '2': 'two', '3': 'three' }"}
1111
]
1212
}

‎resources/function_help/json/map_delete

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"description": "Returns a map with the given key and its corresponding value deleted.",
55
"arguments": [ {"arg":"map","description":"a map"},
66
{"arg":"key","description":"the key to delete"}],
7-
"examples": [ { "expression":"map_delete(map('1','one','2','two'),'2')", "returns":"map: 1: 'one'"}]
7+
"examples": [ { "expression":"map_delete(map('1','one','2','two'),'2')", "returns":"{ '1': 'one' }"}]
88
}

‎resources/function_help/json/map_insert

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"arguments": [ {"arg":"map","description":"a map"},
66
{"arg":"key","description":"the key to add"},
77
{"arg":"value","description":"the value to add"}],
8-
"examples": [ { "expression":"map_insert(map('1','one'),'3','three')", "returns":"map: 1: 'one', 3: 'three'"}]
8+
"examples": [ { "expression":"map_insert(map('1','one'),'3','three')", "returns":"{ '1': 'one', '3': 'three' }"}]
99
}

‎resources/function_help/json/regexp_matches

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{"arg":"string", "description":"the string to capture groups from against the regular expression"},
77
{"arg":"regex","description":"the regular expression used to capture groups"},
88
{"arg":"empty_value","optional":true,"default":"''","description":"the optional string to use as replacement for empty (zero length) matches"}],
9-
"examples": [ { "expression":"regexp_matches('QGIS=>rocks','(.*)=>(.*)')", "returns":"array: 'QGIS', 'rocks'"},
10-
{ "expression":"regexp_matches('key=>','(.*)=>(.*)','empty value')", "returns":"array: 'key', 'empty value'"}
9+
"examples": [ { "expression":"regexp_matches('QGIS=>rocks','(.*)=>(.*)')", "returns":"[ 'QGIS', 'rocks' ]"},
10+
{ "expression":"regexp_matches('key=>','(.*)=>(.*)','empty value')", "returns":"[ 'key', 'empty value' ]"}
1111
]
1212
}

‎resources/function_help/json/string_to_array

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{"arg":"string", "description":"the input string"},
77
{"arg":"delimiter","optional":true,"default":"','","description":"the string delimiter used to split the input string"},
88
{"arg":"empty_value","optional":true,"default":"''","description":"the optional string to use as replacement for empty (zero length) matches"}],
9-
"examples": [ { "expression":"string_to_array('1,2,3',',')", "returns":"array: '1', '2', '3'"},
10-
{ "expression":"string_to_array('1,,3',',','0')", "returns":"array: '1', '0', '3'"}
9+
"examples": [ { "expression":"string_to_array('1,2,3',',')", "returns":"[ '1', '2', '3' ]"},
10+
{ "expression":"string_to_array('1,,3',',','0')", "returns":"[ '1', '0', '3' ]"}
1111
]
1212
}

0 commit comments

Comments
 (0)