How to use the umi-utils.isUrl function in umi-utils

To help you get started, we’ve selected a few umi-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github umijs / umi / packages / umi-build-dev / src / routes / getRouteConfigFromConfig.js View on Github external
function patchRoute(route, pagesPath, parentRoutePath) {
  // clone 是为了避免 patch 多次
  route = clone(route);

  // route.component start from pages
  if (route.component) {
    route.component = resolveComponent(pagesPath, route.component);
  }

  // path patch must be before bigfish patch
  if (route.path && route.path.charAt(0) !== '/') {
    if (isUrl(route.path)) {
      route.path = winPath(route.path);
    } else {
      route.path = winPath(join(parentRoutePath, route.path));
    }
  }

  // Compatible with bigfish
  if (process.env.BIGFISH_COMPAT) {
    if (route.childRoutes) {
      route.routes = route.childRoutes;
      delete route.childRoutes;
    }
    if (route.indexRoute) {
      if (route.indexRoute.redirect) {
        let { redirect } = route.indexRoute;
        if (redirect.charAt(0) !== '/') {