avancement planning
This commit is contained in:
+11
-4
@@ -118,7 +118,7 @@ var stringify = function stringify(
|
||||
|
||||
if (obj === null) {
|
||||
if (strictNullHandling) {
|
||||
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;
|
||||
return formatter(encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix);
|
||||
}
|
||||
|
||||
obj = '';
|
||||
@@ -142,7 +142,9 @@ var stringify = function stringify(
|
||||
if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
||||
// we need to join elements in
|
||||
if (encodeValuesOnly && encoder) {
|
||||
obj = utils.maybeMap(obj, encoder);
|
||||
obj = utils.maybeMap(obj, function (v) {
|
||||
return v == null ? v : encoder(v);
|
||||
});
|
||||
}
|
||||
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
|
||||
} else if (isArray(filter)) {
|
||||
@@ -312,6 +314,11 @@ module.exports = function (object, opts) {
|
||||
var sideChannel = getSideChannel();
|
||||
for (var i = 0; i < objKeys.length; ++i) {
|
||||
var key = objKeys[i];
|
||||
|
||||
if (typeof key === 'undefined' || key === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var value = obj[key];
|
||||
|
||||
if (options.skipNulls && value === null) {
|
||||
@@ -345,10 +352,10 @@ module.exports = function (object, opts) {
|
||||
if (options.charsetSentinel) {
|
||||
if (options.charset === 'iso-8859-1') {
|
||||
// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
||||
prefix += 'utf8=%26%2310003%3B&';
|
||||
prefix += 'utf8=%26%2310003%3B' + options.delimiter;
|
||||
} else {
|
||||
// encodeURIComponent('✓')
|
||||
prefix += 'utf8=%E2%9C%93&';
|
||||
prefix += 'utf8=%E2%9C%93' + options.delimiter;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user