Logs Automatically purges themselves
This commit is contained in:
1 parent
fda24f934c
commit
a42174b233
632 files changed
+19952
-20039
No files matched your search
+9
-6
@@ -50,7 +50,7 @@ var stringify = function stringify( // eslint-disable-line func-name-matching
|
||||
obj = serializeDate(obj);
|
||||
} else if (obj === null) {
|
||||
if (strictNullHandling) {
|
||||
return encoder && !encodeValuesOnly ? encoder(prefix) : prefix;
|
||||
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
|
||||
}
|
||||
|
||||
obj = '';
|
||||
@@ -58,8 +58,8 @@ var stringify = function stringify( // eslint-disable-line func-name-matching
|
||||
|
||||
if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
|
||||
if (encoder) {
|
||||
var keyValue = encodeValuesOnly ? prefix : encoder(prefix);
|
||||
return [formatter(keyValue) + '=' + formatter(encoder(obj))];
|
||||
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
|
||||
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
|
||||
}
|
||||
return [formatter(prefix) + '=' + formatter(String(obj))];
|
||||
}
|
||||
@@ -123,7 +123,7 @@ var stringify = function stringify( // eslint-disable-line func-name-matching
|
||||
|
||||
module.exports = function (object, opts) {
|
||||
var obj = object;
|
||||
var options = opts || {};
|
||||
var options = opts ? utils.assign({}, opts) : {};
|
||||
|
||||
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
|
||||
throw new TypeError('Encoder has to be a function.');
|
||||
@@ -139,7 +139,7 @@ module.exports = function (object, opts) {
|
||||
var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
|
||||
var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
|
||||
if (typeof options.format === 'undefined') {
|
||||
options.format = formats.default;
|
||||
options.format = formats['default'];
|
||||
} else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
|
||||
throw new TypeError('Unknown format option provided.');
|
||||
}
|
||||
@@ -203,5 +203,8 @@ module.exports = function (object, opts) {
|
||||
));
|
||||
}
|
||||
|
||||
return keys.join(delimiter);
|
||||
var joined = keys.join(delimiter);
|
||||
var prefix = options.addQueryPrefix === true ? '?' : '';
|
||||
|
||||
return joined.length > 0 ? prefix + joined : '';
|
||||
};
|
||||
Reference in new issue
Block a user