Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jul 28, 2023
1 parent b9b3b6c commit 17c0ad6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ export function parseQuery(parametersString = ""): QueryObject {
continue;
}
const value = decodeQueryValue(s[2] || "");
if (typeof object[key] !== "undefined") {
if (Array.isArray(object[key])) {
(object[key] as string[]).push(value);
} else {
object[key] = [object[key] as string, value];
}
} else {
if (object[key] === undefined) {
object[key] = value;
} else if (Array.isArray(object[key])) {
(object[key] as string[]).push(value);
} else {
object[key] = [object[key] as string, value];
}
}
return object;
Expand Down

0 comments on commit 17c0ad6

Please sign in to comment.