MCPcopy
hub / github.com/coder/mux / toCoderCompatibleName

Function toCoderCompatibleName

src/node/runtime/CoderSSHRuntime.ts:56–61  ·  view source on GitHub ↗

* Transform a mux workspace name to be Coder-compatible. * - Replace underscores with hyphens * - Remove leading/trailing hyphens * - Collapse multiple consecutive hyphens

(name: string)

Source from the content-addressed store, hash-verified

54 * - Collapse multiple consecutive hyphens
55 */
56function toCoderCompatibleName(name: string): string {
57 return name
58 .replace(/_/g, "-") // Replace underscores with hyphens
59 .replace(/^-+|-+$/g, "") // Remove leading/trailing hyphens
60 .replace(/-{2,}/g, "-"); // Collapse multiple hyphens
61}
62
63const CODER_INACTIVITY_THRESHOLD_MS = 5 * 60 * 1000;
64const CODER_ENSURE_READY_TIMEOUT_MS = 120_000;

Callers 1

finalizeConfigMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected