function getLayerRoutePathInfo(layer) {
  let lrp = _optionalChain([layer, 'access', _14 => _14.route, 'optionalAccess', _15 => _15.path]);

  const isRegex = utils.isRegExp(lrp);
  const isArray = Array.isArray(lrp);

  if (!lrp) {
    // parse node.js major version
    // Next.js will complain if we directly use `proces.versions` here because of edge runtime.
    const [major] = (utils.GLOBAL_OBJ ).process.versions.node.split('.').map(Number);

    // allow call extractOriginalRoute only if node version support Regex d flag, node 16+
    if (major >= 16) {
      /**
       * If lrp does not exist try to recreate original layer path from route regexp
       */
      lrp = extractOriginalRoute(layer.path, layer.regexp, layer.keys);
    }
  }

  if (!lrp) {
    return { isRegex, isArray, numExtraSegments: 0 };
  }

  const numExtraSegments = isArray
    ? Math.max(getNumberOfArrayUrlSegments(lrp ) - utils.getNumberOfUrlSegments(layer.path || ''), 0)
    : 0;

  const layerRoutePath = getLayerRoutePathString(isArray, lrp);

  return { layerRoutePath, isRegex, isArray, numExtraSegments };
}
Extracts and stringifies the layer's route which can either be a string with parameters (`users/:id`),
a RegEx (`/test/`) or an array of strings and regexes (`['/path1', /\/path[2-5]/, /path/:id]`). Additionally
returns extra information about the route, such as if the route is defined as regex or as an array.

@param layer the layer to extract the stringified route from

@returns an object containing the stringified route, a flag determining if the route was a regex
         and the number of extra segments to the matched path that are additionally in the route,
         if the route was an array (defaults to 0).