Function: isAbsoluteRoute()
Documentation / @xmachines/play-xstate / isAbsoluteRoute
function isAbsoluteRoute(path): boolean;Defined in: packages/play-xstate/src/routing/derive-route.ts:150
Check if route path is absolute
Determines whether a route path is absolute (starts with /) or relative.
Absolute paths don’t inherit from parent routes, while relative paths can be
composed with parent paths for nested routing.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Route path to check |
Returns
boolean
true if path starts with ’/’, false otherwise
Example
import { isAbsoluteRoute } from "@xmachines/play-xstate";
console.log(isAbsoluteRoute("/dashboard")); // trueconsole.log(isAbsoluteRoute("settings")); // falseconsole.log(isAbsoluteRoute("./about")); // falseSee
deriveRoute for route extraction