MCPcopy
hub / github.com/tldraw/tldraw / sanitizeRoomId

Function sanitizeRoomId

templates/socketio-server-example/src/server/rooms.ts:11–13  ·  view source on GitHub ↗
(roomId: string)

Source from the content-addressed store, hash-verified

9
10// Sanitize roomId to prevent path traversal attacks
11function sanitizeRoomId(roomId: string): string {
12 return roomId.replace(/[^a-zA-Z0-9_-]/g, '_')
13}
14
15// We'll keep an in-memory map of active rooms
16const rooms = new Map<string, TLSocketRoom<any, void>>()

Callers 1

makeOrLoadRoomFunction · 0.70

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…