diff --git a/packages/core/src/index.js b/packages/core/src/index.js index c2f5ada9..365b66f3 100644 --- a/packages/core/src/index.js +++ b/packages/core/src/index.js @@ -57,7 +57,7 @@ module.exports = { return require('./utils/getActiveChildNavigationOptions').default; }, get pathUtils() { - return require('./routers/pathUtils').default; + return require('./routers/pathUtils'); }, get SceneView() { diff --git a/packages/core/src/routers/pathUtils.js b/packages/core/src/routers/pathUtils.js index 90e5ffaf..be9eea1b 100644 --- a/packages/core/src/routers/pathUtils.js +++ b/packages/core/src/routers/pathUtils.js @@ -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, -};