MCPcopy Create free account
hub / github.com/cameri/nostream / groupHexCriteria

Method groupHexCriteria

src/repositories/event-repository.ts:182–201  ·  view source on GitHub ↗
(criteria: string[])

Source from the content-addressed store, hash-verified

180 }
181
182 private groupHexCriteria(criteria: string[]): HexCriterionGroups {
183 return criteria.reduce<HexCriterionGroups>(
184 (groups, criterion) => {
185 if (criterion.length === 64) {
186 groups.exact.push(criterion)
187 } else if (criterion.length % 2 === 0) {
188 groups.even.push(criterion)
189 } else {
190 groups.odd.push(criterion)
191 }
192
193 return groups
194 },
195 {
196 exact: [],
197 even: [],
198 odd: [],
199 },
200 )
201 }
202
203 private applyGenericTagFilterConditions(builder: any, currentFilter: SubscriptionFilter): boolean {
204 const tagFilters = Object.entries(currentFilter).filter(([filterName]) => isGenericTagQuery(filterName))

Callers 1

applyHexCriteriaMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected