synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
15 lines (14 loc) • 472 B
JavaScript
import n from "dayjs";
function f(e) {
const o = e.find(
(t) => n().isAfter(n(t.roundStart)) && n().isBefore(n(t.roundEnd))
);
if (o)
return o;
const u = e.reduce((t, r) => n().isBefore(r.roundStart) && (t == null || n(r.roundStart).isBefore(t.roundStart)) ? r : t, void 0);
return u || e.reduce((t, r) => n(r.roundEnd).isAfter(n(t.roundEnd)) ? r : t, e[0]);
}
export {
f as getCurrentOrNextOrLatestRound
};
//# sourceMappingURL=EvaluationUtils.js.map