Skip to content

Commit

Permalink
Fix reduce() return type signature (#15386)
Browse files Browse the repository at this point in the history
Fix `reduce()` return type signature. 
Note: The
[documentation](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-functions-lambda#reduce)
indicates the correct return type of `any`.

Before:
<img width="966" alt="reduce_before"
src="https://github.com/user-attachments/assets/50c810d2-6e8e-4607-b559-338e72a450e3">

After:
<img width="728" alt="reduce_after"
src="https://github.com/user-attachments/assets/415ecaaa-30bd-49cb-8a87-ad830a71d122">

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/15386)

Co-authored-by: Levi Muriuki <muriukilevi@microsoft.com>
  • Loading branch information
levimatheri and Levi Muriuki authored Oct 21, 2024
1 parent 12531f1 commit ea90624
Show file tree
Hide file tree
Showing 51 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion src/Bicep.Core.Samples/Files/baselines/Functions/sys.json
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@
"minimumArgumentCount": 3,
"maximumArgumentCount": 3,
"flags": "default",
"typeSignature": "(array: array, initialValue: any, predicate: (any, any[, int]) => any): array",
"typeSignature": "(array: array, initialValue: any, predicate: (any, any[, int]) => any): any",
"parameterTypeSignatures": [
"array: array",
"initialValue: any",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2332,7 +2332,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4823,7 +4823,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4787,7 +4787,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4815,7 +4815,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5046,7 +5046,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5046,7 +5046,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5046,7 +5046,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5046,7 +5046,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4794,7 +4794,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4794,7 +4794,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4794,7 +4794,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4794,7 +4794,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5280,7 +5280,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5280,7 +5280,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5280,7 +5280,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5280,7 +5280,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4801,7 +4801,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4801,7 +4801,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4801,7 +4801,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4801,7 +4801,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4794,7 +4794,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4794,7 +4794,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4794,7 +4794,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4794,7 +4794,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4773,7 +4773,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4773,7 +4773,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4899,7 +4899,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4790,7 +4790,7 @@
"kind": "function",
"documentation": {
"kind": "markdown",
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): array\n\n``` \nReduces an array with a custom reduce function. \n"
"value": "```bicep\nreduce(array: array, initialValue: any, predicate: (any, any[, int]) => any): any\n\n``` \nReduces an array with a custom reduce function. \n"
},
"deprecated": false,
"preselect": false,
Expand Down
Loading

0 comments on commit ea90624

Please sign in to comment.