silverwolf-x's picture
download
raw
822 Bytes
import {
extractInterceptionRouteInformation,
isInterceptionRouteAppPath,
} from './interception-routes'
// Identify /.*[param].*/ in route string
const TEST_ROUTE = /\/[^/]*\[[^/]+\][^/]*(?=\/|$)/
// Identify /[param]/ in route string
const TEST_STRICT_ROUTE = /\/\[[^/]+\](?=\/|$)/
/**
* Check if a route is dynamic.
*
* @param route - The route to check.
* @param strict - Whether to use strict mode which prohibits segments with prefixes/suffixes (default: true).
* @returns Whether the route is dynamic.
*/
export function isDynamicRoute(route: string, strict: boolean = true): boolean {
if (isInterceptionRouteAppPath(route)) {
route = extractInterceptionRouteInformation(route).interceptedRoute
}
if (strict) {
return TEST_STRICT_ROUTE.test(route)
}
return TEST_ROUTE.test(route)
}

Xet Storage Details

Size:
822 Bytes
·
Xet hash:
72356f237d385bdfe3accdf648ba0641b56cc17a1240e8b6f3ffed8f591fe145

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.