UNPKG

wcif-helpers

Version:
20 lines 911 B
export const getEventInfoFromWcif = (eventId, wcif) => { return wcif.events.find((event) => event.id === eventId); }; export const getRoundInfoFromWcif = (roundId, wcif) => { const eventId = getEventIdFromRoundId(roundId); const event = getEventInfoFromWcif(eventId, wcif); return event === null || event === void 0 ? void 0 : event.rounds.find((round) => round.id === roundId); }; export const getEventIdFromRoundId = (roundId) => { return roundId.split("-")[0]; }; export const getCutoffByRoundId = (roundId, wcif) => { const round = getRoundInfoFromWcif(roundId, wcif); return (round === null || round === void 0 ? void 0 : round.cutoff) || null; }; export const getLimitByRoundId = (roundId, wcif) => { const round = getRoundInfoFromWcif(roundId, wcif); return (round === null || round === void 0 ? void 0 : round.timeLimit) || null; }; //# sourceMappingURL=events.js.map