mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Merge pull request #34273 from dpsmith3/qs-add-comma-to-parse-options
[qs] Add 'comma' to parse options
This commit is contained in:
4
types/qs/index.d.ts
vendored
4
types/qs/index.d.ts
vendored
@@ -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 <https://github.com/RWander>
|
||||
// Leon Yu <https://github.com/leonyu>
|
||||
@@ -6,6 +6,7 @@
|
||||
// Melvin Lee <https://github.com/zyml>
|
||||
// Arturs Vonda <https://github.com/artursvonda>
|
||||
// Carlos Bonetti <https://github.com/CarlosBonetti>
|
||||
// Dan Smith <https://github.com/dpsmith3>
|
||||
// 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;
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user