The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | export interface DeviceHubAccess { |
| 2 | readonly httpBase: string; |
| 3 | readonly wsBase: string; |
| 4 | readonly query: Readonly<Record<string, string>>; |
| 5 | readonly credentials: boolean; |
| 6 | } |
| 7 | |
| 8 | export const withDeviceHubQuery = (url: string, access: DeviceHubAccess): string => { |
| 9 | const entries = Object.entries(access.query); |
| 10 | if (entries.length === 0) return url; |
| 11 | const separator = url.includes("?") ? "&" : "?"; |
| 12 | return `${url}${separator}${new URLSearchParams(entries).toString()}`; |
| 13 | }; |