fix path utils export again

This commit is contained in:
Eric Vicenti
2018-10-11 16:00:22 -07:00
parent aa58e8704a
commit 949ec1ab6d
2 changed files with 4 additions and 10 deletions

View File

@@ -57,7 +57,7 @@ module.exports = {
return require('./utils/getActiveChildNavigationOptions').default;
},
get pathUtils() {
return require('./routers/pathUtils').default;
return require('./routers/pathUtils');
},
get SceneView() {

View File

@@ -12,7 +12,7 @@ function isEmpty(obj) {
return true;
}
const getParamsFromPath = (inputParams, pathMatch, pathMatchKeys) => {
export const getParamsFromPath = (inputParams, pathMatch, pathMatchKeys) => {
const params = pathMatch.slice(1).reduce(
// iterate over matched path params
(paramsOut, matchResult, i) => {
@@ -44,7 +44,7 @@ const getRestOfPath = (pathMatch, pathMatchKeys) => {
return rest;
};
const urlToPathAndParams = (url, uriPrefix) => {
export const urlToPathAndParams = (url, uriPrefix) => {
const searchMatch = url.match(/^(.*)\?(.*)$/);
const params = searchMatch ? queryString.parse(searchMatch[2]) : {};
const urlWithoutSearch = searchMatch ? searchMatch[1] : url;
@@ -65,7 +65,7 @@ const urlToPathAndParams = (url, uriPrefix) => {
};
};
const createPathParser = (
export const createPathParser = (
childRouters,
routeConfigs,
{ paths: pathConfigs = {}, disableRouteNamePaths }
@@ -217,9 +217,3 @@ const createPathParser = (
};
return { getActionForPathAndParams, getPathAndParamsForRoute };
};
export default {
getParamsFromPath,
createPathParser,
urlToPathAndParams,
};