This commit is contained in:
Keyan Zhang
2017-10-31 23:47:15 -07:00
parent d73bff0982
commit 5cc60281b5
2 changed files with 5 additions and 3 deletions

2
flow-typed/qs.js vendored
View File

@@ -1,5 +1,5 @@
declare module 'qs' {
declare module.exports: {
parse: (str: string, opts: Object) => Object;
parse: (str: string, opts: Object) => Object,
};
}

View File

@@ -41,7 +41,9 @@ function urlify(str: string): Node {
// `?invariant=123&args[]=foo&args[]=bar`
// or `// ?invariant=123&args[0]=foo&args[1]=bar`
function parseQueryString(search: string): ?{code: string, args: Array<string>} {
function parseQueryString(
search: string,
): ?{|code: string, args: Array<string>|} {
const qsResult = qs.parse(search, {ignoreQueryPrefix: true});
if (!qsResult.invariant) {
return null;
@@ -52,7 +54,7 @@ function parseQueryString(search: string): ?{code: string, args: Array<string>}
};
}
function ErrorResult(props: {code: ?string, msg: string}) {
function ErrorResult(props: {|code: ?string, msg: string|}) {
const code = props.code;
const errorMsg = props.msg;