* Invalidate all entries for a given worktree path.
(prefix: string)
| 107 | * Invalidate all entries for a given worktree path. |
| 108 | */ |
| 109 | invalidateByPrefix(prefix: string): number { |
| 110 | let count = 0; |
| 111 | const keys = Array.from(this.cache.keys()); |
| 112 | for (const key of keys) { |
| 113 | if (key.startsWith(prefix)) { |
| 114 | this.delete(key); |
| 115 | count++; |
| 116 | } |
| 117 | } |
| 118 | return count; |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * Clear all entries. |
no test coverage detected