Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/router / dist / react-router-config / matchRoutes.js
Size: Mime:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * @see https://github.com/ReactTraining/react-router/tree/master/packages/react-router
 * ^ changes for import
 */
const react_router_1 = require("react-router");
function matchRoutes(routes, pathname, /*not public API*/ branch = []) {
    routes.some(route => {
        const match = route.path
            ? react_router_1.matchPath(pathname, route)
            : branch.length
                // use parent match
                ? branch[branch.length - 1].match
                /** @todo typing here */
                // use default "root" match
                : react_router_1.Router.computeRootMatch(pathname);
        if (match) {
            branch.push({ route, match });
            if (route.routes) {
                matchRoutes(route.routes, pathname, branch);
            }
        }
        return match;
    });
    return branch;
}
exports.default = matchRoutes;
//# sourceMappingURL=matchRoutes.js.map