Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
fix(uri-parser): Parse comma separated option values
Browse files Browse the repository at this point in the history
Enable parsing of comma separated option values into arrays.

Fixes NODE-1612
  • Loading branch information
Rebecca Weinberger authored and mbroadst committed Aug 8, 2018
1 parent 6e33bd9 commit 2dd1de0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/uri_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ function parseQueryStringItemValue(value) {
result[parts[0]] = parseQueryStringItemValue(parts[1]);
return result;
}, {});
} else if (value.indexOf(',') > 0) {
value = value.split(',').map(v => {
return parseQueryStringItemValue(v);
});
} else if (value.toLowerCase() === 'true' || value.toLowerCase() === 'false') {
value = value.toLowerCase() === 'true';
} else if (!Number.isNaN(value)) {
Expand Down

0 comments on commit 2dd1de0

Please sign in to comment.