MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / withDriveCase

Function withDriveCase

__tests__/daemon-rendezvous-case.test.ts:53–55  ·  view source on GitHub ↗

The same drive letter, forced to one case. No-op on a path without a drive.

(p: string, upper: boolean)

Source from the content-addressed store, hash-verified

51
52/** The same drive letter, forced to one case. No-op on a path without a drive. */
53function withDriveCase(p: string, upper: boolean): string {
54 return p.replace(/^[a-z]:/i, (drive) => (upper ? drive.toUpperCase() : drive.toLowerCase()));
55}
56
57describe('daemon rendezvous key', () => {
58 it('collapses redundant path segments to one socket name', () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected