nostr-idb 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -166,18 +166,12 @@ export async function getIdsForFilter(db, filter, indexCache) {
|
|
|
166
166
|
export async function getIdsForFilters(db, filters, indexCache) {
|
|
167
167
|
if (filters.length === 0)
|
|
168
168
|
throw new Error("No Filters");
|
|
169
|
-
let ids =
|
|
169
|
+
let ids = new Set();
|
|
170
170
|
for (const filter of filters) {
|
|
171
171
|
const filterIds = await getIdsForFilter(db, filter, indexCache);
|
|
172
|
-
|
|
173
|
-
ids
|
|
174
|
-
else
|
|
175
|
-
for (const id of ids)
|
|
176
|
-
if (!filterIds.has(id))
|
|
177
|
-
ids.delete(id);
|
|
172
|
+
for (const id of filterIds)
|
|
173
|
+
ids.add(id);
|
|
178
174
|
}
|
|
179
|
-
if (ids === null)
|
|
180
|
-
throw new Error("Empty filters");
|
|
181
175
|
return ids;
|
|
182
176
|
}
|
|
183
177
|
async function loadEventsByUID(db, uids, filters) {
|
package/dist/relay/relay-core.js
CHANGED