Merge pull request #5812 from RWander/qs

Qs
This commit is contained in:
Horiuchi_H
2015-09-15 11:44:51 +09:00
2 changed files with 44 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
/// <reference path="./qs.d.ts" />
import qs = require('qs');
qs.stringify({ a: 'b' });
qs.stringify({ a: 'b', c: 'd' }, { delimiter: '&' });
qs.parse('a=b');
qs.parse('a=b&c=d', { delimiter: '&' });
Vendored
+35
View File
@@ -0,0 +1,35 @@
// Type definitions for qs
// Project: https://github.com/hapijs/qs
// Definitions by: Roman Korneev <https://github.com/RWander>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module QueryString {
interface IStringifyOptions {
delimiter?: string;
strictNullHandling?: boolean;
skipNulls?: boolean;
encode?: boolean;
filter?: any;
arrayFormat?: any;
indices?: string;
}
interface IParseOptions {
delimiter?: string;
depth?: number;
arrayLimit?: number;
parseArrays?: boolean;
allowDots?: boolean;
plainObjects?: boolean;
allowPrototypes?: boolean;
parameterLimit?: number;
strictNullHandling?: boolean;
}
function stringify(obj: any, options?: IStringifyOptions): string;
function parse(str: string, options?: IParseOptions): any;
}
declare module "qs" {
export = QueryString;
}