@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 13 lines 480 Bytes
Raw
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 };