Skip to content

Commit

Permalink
Fix handling of bracket syntax for array params where a single elemen…
Browse files Browse the repository at this point in the history
…t is passed in
  • Loading branch information
rchodava committed Jul 20, 2023
1 parent 17dbe72 commit 78553a9
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ const parseQueryParams = (
parsed_input[key] = array_input.split(",")
}

if (Array.isArray(input[`${key}[]`])) {
parsed_input[key] = input[`${key}[]`]
const bracket_syntax_array_input = input[`${key}[]`]
if (typeof bracket_syntax_array_input === "string") {
const pre_split_array = bracket_syntax_array_input
parsed_input[key] = pre_split_array.split(",")
}

if (Array.isArray(bracket_syntax_array_input)) {
parsed_input[key] = bracket_syntax_array_input
}

continue
Expand Down

0 comments on commit 78553a9

Please sign in to comment.