Skip to content

Commit

Permalink
v6.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Nov 8, 2019
1 parent 6151be3 commit 7b36800
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## **6.9.1**
- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335)
- [Fix] `parse`: with comma true, do not split non-string values (#334)
- [meta] add `funding` field
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`
- [Tests] use shared travis-ci config

## **6.9.0**
- [New] `parse`/`stringify`: Pass extra key/value argument to `decoder` (#333)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `evalmd`
Expand Down
8 changes: 7 additions & 1 deletion dist/qs.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module.exports = {
var utils = require('./utils');

var has = Object.prototype.hasOwnProperty;
var isArray = Array.isArray;

var defaults = {
allowDots: false,
Expand Down Expand Up @@ -125,10 +126,14 @@ var parseValues = function parseQueryStringValues(str, options) {
val = interpretNumericEntities(val);
}

if (val && options.comma && val.indexOf(',') > -1) {
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
val = val.split(',');
}

if (part.indexOf('[]=') > -1) {
val = isArray(val) ? [val] : val;
}

if (has.call(obj, key)) {
obj[key] = utils.combine(obj[key], val);
} else {
Expand Down Expand Up @@ -611,6 +616,7 @@ var arrayToObject = function arrayToObject(source, options) {
};

var merge = function merge(target, source, options) {
/* eslint no-param-reassign: 0 */
if (!source) {
return target;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "qs",
"description": "A querystring parser that supports nesting and arrays, with a depth limit",
"homepage": "https://github.com/ljharb/qs",
"version": "6.9.0",
"version": "6.9.1",
"repository": {
"type": "git",
"url": "https://github.com/ljharb/qs.git"
Expand Down

0 comments on commit 7b36800

Please sign in to comment.