(filename: string)
| 31 | } |
| 32 | |
| 33 | function unsanitizeId(filename: string): string { |
| 34 | if (filename === "code_repos") return "code:repos" |
| 35 | if (filename === "code_personal_settings") return "code:personal_settings" |
| 36 | if (filename === "code_mcp_servers") return "code:mcp_servers" |
| 37 | if (filename.startsWith("code_task_")) return `code:task:${filename.slice("code_task_".length)}` |
| 38 | if (filename.startsWith("code_scratchpad-index_")) return `code:scratchpad-index:${filename.slice("code_scratchpad-index_".length)}` |
| 39 | if (filename.startsWith("code_scratchpad_")) return `code:scratchpad:${filename.slice("code_scratchpad_".length)}` |
| 40 | return filename.replace(/_/g, ":") |
| 41 | } |
| 42 | |
| 43 | function isRecord(value: unknown): value is Record<string, unknown> { |
| 44 | return typeof value === "object" && value !== null && !Array.isArray(value) |
no test coverage detected