Function: validateRouteFormat()
API / @xmachines/play-router / validateRouteFormat
function validateRouteFormat(routePath, stateId): void;Defined in: validate-routes.ts:27
Checks the format of a route path
The function requires a string that is not empty. It accepts an absolute path (“/foo”) and also a relative path (“foo” or “child/nested”). A relative route receives the path prefix of its parent state during the construction of the tree.
Parameters
| Parameter | Type | Description |
|---|---|---|
routePath | string | The route path to check: absolute or relative |
stateId | string | The identifier of the state, for the error message |
Returns
void
Throws
When the route path is empty