hierarchical-approval 3.2.0 → 3.3.0

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/dist/testing.cjs CHANGED
@@ -284,8 +284,7 @@ var MemoryAdapter = class {
284
284
  async getInstancesByApprover(tenantId, approverId, opts) {
285
285
  const all = [...this.instances.values()].filter((i) => {
286
286
  if (i.tenantId !== tenantId || i.status !== "pending") return false;
287
- const currentLevel = i.levels.find((l) => l.level === i.currentLevel);
288
- return currentLevel?.approverIds.includes(approverId) ?? false;
287
+ return i.levels.some((l) => l.status === "pending" && l.approverIds.includes(approverId));
289
288
  });
290
289
  return paginate(
291
290
  all.map((i) => reviveDates(deepClone(i))),