Skip to content

Commit

Permalink
pkg: cockpit: fix typo value in cockpit.location.decode()
Browse files Browse the repository at this point in the history
Porting this to TS uncovers a type issue as `last` can be a string
which throws a TypeError as String has no push() method.
  • Loading branch information
jelly committed Nov 22, 2024
1 parent 3028c8a commit d880ee9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/lib/cockpit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ function factory() {
const value = decodeURIComponent(parts[1]);
if (options[name]) {
let last = options[name];
if (!Array.isArray(value))
if (!Array.isArray(last))
last = options[name] = [last];
last.push(value);
} else {
Expand Down

0 comments on commit d880ee9

Please sign in to comment.