Files
oh-my-pi/packages/coding-agent/src/ssh/utils.ts
T
2026-02-22 11:01:11 +01:00

9 lines
308 B
TypeScript

export function sanitizeHostName(name: string): string {
const sanitized = name.replace(/[^a-zA-Z0-9._-]+/g, "_");
return sanitized.length > 0 ? sanitized : "remote";
}
export function buildSshTarget(username: string | undefined, host: string): string {
return username ? `${username}@${host}` : host;
}