@@ -69,6 +69,15 @@ export interface ParseOptions {
6969 //=> {foo: ['1', '2', '3'], bar: 'fluffy', baz:['4']}
7070 ```
7171
72+ - `colon-list-separator`: Parse arrays with parameter names that are explicitly marked with `:list`:
73+
74+ ```
75+ import queryString = require('query-string');
76+
77+ queryString.parse('foo:list=one&foo:list=two', {arrayFormat: 'colon-list-separator'});
78+ //=> {foo: ['one', 'two']}
79+ ```
80+
7281 - `none`: Parse arrays with elements using duplicate keys:
7382
7483 ```
@@ -78,7 +87,7 @@ export interface ParseOptions {
7887 //=> {foo: ['1', '2', '3']}
7988 ```
8089 */
81- readonly arrayFormat ?: 'bracket' | 'index' | 'comma' | 'separator' | 'bracket-separator' | 'none' ;
90+ readonly arrayFormat ?: 'bracket' | 'index' | 'comma' | 'separator' | 'bracket-separator' | 'colon-list-separator' | ' none';
8291
8392 /**
8493 The character used to separate array elements when using `{arrayFormat: 'separator'}`.
@@ -296,6 +305,15 @@ export interface StringifyOptions {
296305 //=> 'foo[]=1|2|3&bar=fluffy&baz[]=4'
297306 ```
298307
308+ - `colon-list-separator`: Serialize arrays with parameter names that are explicitly marked with `:list`:
309+
310+ ```js
311+ import queryString = require('query-string');
312+
313+ queryString.stringify({foo: ['one', 'two']}, {arrayFormat: 'colon-list-separator'});
314+ //=> 'foo:list=one&foo:list=two'
315+ ```
316+
299317 - `none`: Serialize arrays by using duplicate keys:
300318
301319 ```
@@ -305,7 +323,7 @@ export interface StringifyOptions {
305323 //=> 'foo=1&foo=2&foo=3'
306324 ```
307325 */
308- readonly arrayFormat ?: 'bracket' | 'index' | 'comma' | 'separator' | 'bracket-separator' | 'none' ;
326+ readonly arrayFormat ?: 'bracket' | 'index' | 'comma' | 'separator' | 'bracket-separator' | 'colon-list-separator' | ' none';
309327
310328 /**
311329 The character used to separate array elements when using `{arrayFormat: 'separator'}`.
0 commit comments