Function
listCheckPage
(
env: CacheEnv,
def: QueryDef,
logKey: () => string,
page: unknown
)
Source from the content-addressed store, hash-verified
| 4736 | }) |
| 4737 | |
| 4738 | const listCheckPage = ( |
| 4739 | env: CacheEnv, |
| 4740 | def: QueryDef, |
| 4741 | logKey: () => string, |
| 4742 | page: unknown |
| 4743 | ): void => { |
| 4744 | const list = def.list! |
| 4745 | const seen = new Set<string>() |
| 4746 | for (const item of list.items(page)) { |
| 4747 | const key = list.key(item) |
| 4748 | if (!seen.has(key)) { |
| 4749 | seen.add(key) |
| 4750 | continue |
| 4751 | } |
| 4752 | const at = logKey() |
| 4753 | env.report( |
| 4754 | new DuplicateKeyInPage({ |
| 4755 | query: def.name, |
| 4756 | logKey: at, |
| 4757 | message: "[Query] a page of " + quote(def.name) + " at " + at + |
| 4758 | " holds two items with one key. The first is kept." |
| 4759 | }) |
| 4760 | ) |
| 4761 | return |
| 4762 | } |
| 4763 | } |
| 4764 | |
| 4765 | const listWalk = ( |
| 4766 | env: CacheEnv, |
Tested by
no test coverage detected