This commit is contained in:
Vojtech Novak 2017-11-14 17:28:52 +01:00 committed by Lorenzo Sciandra
parent fafe68b8cb
commit 44616dd45a

View File

@ -30,6 +30,14 @@ function _getUuid() {
return `${uniqueBaseId}-${uuidCount++}`; return `${uniqueBaseId}-${uuidCount++}`;
} }
function isEmpty(obj: ?Object): boolean {
if (!obj) return true;
for (let key in obj) {
return false;
}
return true;
}
export default ( export default (
routeConfigs: NavigationRouteConfigMap, routeConfigs: NavigationRouteConfigMap,
stackConfig: NavigationStackRouterConfig = {} stackConfig: NavigationStackRouterConfig = {}
@ -375,9 +383,9 @@ export default (
// reduce the items of the query string. any query params may // reduce the items of the query string. any query params may
// be overridden by path params // be overridden by path params
const queryParams = const queryParams = !isEmpty(inputParams)
inputParams || ? inputParams
(queryString || '').split('&').reduce((result: *, item: string) => { : (queryString || '').split('&').reduce((result: *, item: string) => {
if (item !== '') { if (item !== '') {
const nextResult = result || {}; const nextResult = result || {};
const [key, value] = item.split('='); const [key, value] = item.split('=');