From 99fe1ec74140e09a51c41169264bad7924571945 Mon Sep 17 00:00:00 2001 From: Adrien Montfort Date: Wed, 4 Oct 2017 18:50:52 +0200 Subject: [PATCH] Rename formats.default to formats.defaultFormat --- lib/formats.js | 2 +- lib/stringify.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/formats.js b/lib/formats.js index df459975..83f1018f 100644 --- a/lib/formats.js +++ b/lib/formats.js @@ -4,7 +4,7 @@ var replace = String.prototype.replace; var percentTwenties = /%20/g; module.exports = { - 'default': 'RFC3986', + defaultFormat: 'RFC3986', formatters: { RFC1738: function (value) { return replace.call(value, percentTwenties, '+'); diff --git a/lib/stringify.js b/lib/stringify.js index ab915ac4..0228c41c 100644 --- a/lib/stringify.js +++ b/lib/stringify.js @@ -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.defaultFormat; } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { throw new TypeError('Unknown format option provided.'); }