Skip to content

Commit

Permalink
run build and format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 3, 2022
1 parent 37d6c38 commit 45d661a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24104,6 +24104,7 @@ var stringify = function stringify(
object,
prefix,
generateArrayPrefix,
commaRoundTrip,
strictNullHandling,
skipNulls,
encoder,
Expand Down Expand Up @@ -24168,7 +24169,7 @@ var stringify = function stringify(
for (var i = 0; i < valuesArray.length; ++i) {
valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
}
return [formatter(keyValue) + (isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
}
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
}
Expand All @@ -24192,7 +24193,7 @@ var stringify = function stringify(
objKeys = sort ? keys.sort(sort) : keys;
}

var adjustedPrefix = generateArrayPrefix === 'comma' && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;

for (var j = 0; j < objKeys.length; ++j) {
var key = objKeys[j];
Expand All @@ -24213,6 +24214,7 @@ var stringify = function stringify(
value,
keyPrefix,
generateArrayPrefix,
commaRoundTrip,
strictNullHandling,
skipNulls,
encoder,
Expand Down Expand Up @@ -24309,6 +24311,10 @@ module.exports = function (object, opts) {
}

var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
}
var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;

if (!objKeys) {
objKeys = Object.keys(obj);
Expand All @@ -24329,6 +24335,7 @@ module.exports = function (object, opts) {
obj[key],
key,
generateArrayPrefix,
commaRoundTrip,
options.strictNullHandling,
options.skipNulls,
options.encode ? options.encoder : null,
Expand Down

0 comments on commit 45d661a

Please sign in to comment.