import { getHappeningStore } from "./store.js";
export async function listHappenings(options) {
    const types = Array.isArray(options.type) ? options.type : (options.type?.length ? [options.type] : []);
    const store = getHappeningStore();
    let values = await store.values();
    // TODO filter using indexes rather than filtering in memory
    if (types.length) {
        values = values.filter(happening => types.includes(happening.type));
    }
    return values;
}
//# sourceMappingURL=list-happenings.js.map