UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

15 lines (14 loc) 472 B
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