Skip to content

Commit 3822686

Browse files
committed
fix: handle array values in stringify
1 parent 17f77a0 commit 3822686

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/stringify.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function getAsPrimitive(value) {
2121
}
2222

2323
/**
24-
* @callback
25-
* @param {any} input
26-
* @return {string}
24+
* @param {Record<string, string | number | boolean
25+
* | ReadonlyArray<string | number | boolean> | null>} input
26+
* @returns {string}
2727
*/
2828
function stringify(input) {
2929
let result = "";
@@ -32,9 +32,9 @@ function stringify(input) {
3232
return result;
3333
}
3434

35-
const keys = Object.getOwnPropertyNames(input);
36-
const keyLength = keys.length;
3735
const separator = "&";
36+
const keys = Object.keys(input);
37+
const keyLength = keys.length;
3838
let valueLength = 0;
3939

4040
for (let i = 0; i < keyLength; i++) {

0 commit comments

Comments
 (0)