diff --git a/lib/parse.js b/lib/parse.js index dc488150..f0d8c3cc 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -229,8 +229,10 @@ var normalizeParseOptions = function normalizeParseOptions(opts) { throw new TypeError('The duplicates option must be either combine, first, or last'); } + var allowDots = typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots; + return { - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, + allowDots: allowDots, allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, diff --git a/lib/stringify.js b/lib/stringify.js index 393ef69a..d71ffc0b 100644 --- a/lib/stringify.js +++ b/lib/stringify.js @@ -238,9 +238,11 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); } + var allowDots = typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots; + return { addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, + allowDots: allowDots, allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, arrayFormat: arrayFormat, charset: charset,