(id: string)
| 23 | const saveQueues = new Map<string, Promise<void>>() |
| 24 | |
| 25 | function sanitizeId(id: string): string { |
| 26 | const sanitized = id.replace(/:/g, "_") |
| 27 | if (sanitized.includes("..") || sanitized.includes("/") || sanitized.includes("\\")) { |
| 28 | throw new Error(`Invalid document ID: ${id}`) |
| 29 | } |
| 30 | return sanitized |
| 31 | } |
| 32 | |
| 33 | function unsanitizeId(filename: string): string { |
| 34 | if (filename === "code_repos") return "code:repos" |
no test coverage detected