diff --git a/types/qs/index.d.ts b/types/qs/index.d.ts index aead3eb442..d999ed58e9 100644 --- a/types/qs/index.d.ts +++ b/types/qs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for qs 6.5.0 +// Type definitions for qs 6.5 // Project: https://github.com/ljharb/qs // Definitions by: Roman Korneev // Leon Yu @@ -6,6 +6,7 @@ // Melvin Lee // Arturs Vonda // Carlos Bonetti +// Dan Smith // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = QueryString; @@ -30,6 +31,7 @@ declare namespace QueryString { } interface IParseOptions { + comma?: boolean; delimiter?: string | RegExp; depth?: number; decoder?: (str: string) => any; diff --git a/types/qs/qs-tests.ts b/types/qs/qs-tests.ts index 2054292a1f..56a607bdb6 100644 --- a/types/qs/qs-tests.ts +++ b/types/qs/qs-tests.ts @@ -238,6 +238,11 @@ qs.parse('a=b&c=d', { delimiter: '&' }); assert.deepEqual(parsedQueryPrefix, { a: '', b: '' }); } +() => { + var parsedCommaSeparatedArray = qs.parse('?a=b,c', { comma: true }); + assert.equal(parsedCommaSeparatedArray, { a: ['b', 'c']}); +} + () => { var nullsSkipped = qs.stringify({ a: 'b', c: null }, { skipNulls: true }); assert.equal(nullsSkipped, 'a=b'); diff --git a/types/qs/tslint.json b/types/qs/tslint.json index 3d59f55fda..4097220f43 100644 --- a/types/qs/tslint.json +++ b/types/qs/tslint.json @@ -7,7 +7,6 @@ "ban-types": false, "callable-types": false, "comment-format": false, - "dt-header": false, "npm-naming": false, "eofline": false, "export-just-namespace": false,