Skip to content

Function: validateRouteFormat()

API / @xmachines/play-router / validateRouteFormat

function validateRouteFormat(routePath, stateId): void;

Defined in: validate-routes.ts:15

Validate route path format

Ensures route paths are non-empty strings. Both absolute paths (“/foo”) and relative paths (“foo”, “child/nested”) are accepted. Relative routes inherit their parent state’s path prefix when the tree is built.

Parameters

ParameterTypeDescription
routePathstringRoute path to validate (absolute or relative)
stateIdstringState identifier for error messages

Returns

void

Throws

If route path is empty