From 57109e0d4070aa9e65aecebb8bdcbd567c70d856 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Wed, 27 Mar 2019 16:10:28 +0000 Subject: [PATCH 1/2] [qs] Add 'comma' to parse options --- types/qs/index.d.ts | 4 +++- types/qs/qs-tests.ts | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/qs/index.d.ts b/types/qs/index.d.ts index aead3eb442..5257ca1f12 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.1 // 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'); From bc221677a22ee4dec711d436bd2b9ee64f1170f4 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 9 Apr 2019 10:10:57 +0100 Subject: [PATCH 2/2] [qs] Fix header and remove dt-header false from tslint.json --- types/qs/index.d.ts | 2 +- types/qs/tslint.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/types/qs/index.d.ts b/types/qs/index.d.ts index 5257ca1f12..d999ed58e9 100644 --- a/types/qs/index.d.ts +++ b/types/qs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for qs 6.5.1 +// Type definitions for qs 6.5 // Project: https://github.com/ljharb/qs // Definitions by: Roman Korneev // Leon Yu 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,