(path, pattern)
| 231 | return val; |
| 232 | } |
| 233 | add(path, pattern) { |
| 234 | let cache = this.#cache.get(path); |
| 235 | if (!cache) { |
| 236 | cache = new SafeSet(); |
| 237 | this.#cache.set(path, cache); |
| 238 | } |
| 239 | const originalSize = cache.size; |
| 240 | pattern.indexes.forEach((index) => cache.add(pattern.cacheKey(index))); |
| 241 | return cache.size !== originalSize + pattern.indexes.size; |
| 242 | } |
| 243 | seen(path, pattern, index) { |
| 244 | return this.#cache.get(path)?.has(pattern.cacheKey(index)); |
| 245 | } |