MCPcopy Index your code
hub / github.com/anomalyco/opencode / initialRoute

Function initialRoute

packages/tui/src/context/route.tsx:44–53  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

42})
43
44function initialRoute(value: unknown): Route | undefined {
45 if (!value || typeof value !== "object" || !("type" in value)) return
46 if (value.type === "home") return { type: "home" }
47 if (value.type === "session" && "sessionID" in value && typeof value.sessionID === "string") {
48 return { type: "session", sessionID: value.sessionID }
49 }
50 if (value.type === "plugin" && "id" in value && typeof value.id === "string") {
51 return { type: "plugin", id: value.id }
52 }
53}
54
55export type RouteContext = ReturnType<typeof useRoute>
56

Callers 1

route.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected