()
| 138 | } |
| 139 | |
| 140 | const restore = () => { |
| 141 | // Restore original index methods |
| 142 | for (const [indexId, index] of collection.indexes) { |
| 143 | const original = originalMethods.get(indexId) |
| 144 | if (original) { |
| 145 | index.lookup = original.lookup |
| 146 | if (original.rangeQuery) { |
| 147 | index.rangeQuery = original.rangeQuery |
| 148 | } |
| 149 | } |
| 150 | } |
| 151 | collection.entries = originalEntries |
| 152 | } |
| 153 | |
| 154 | return { stats, restore } |
| 155 | } |