From b122a2bda9ada03f5148208a8905da7a30f082d6 Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 27 Nov 2023 08:24:01 +0800 Subject: [PATCH] core: export buildContestRule to plugin api --- packages/hydrooj/src/model/contest.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/hydrooj/src/model/contest.ts b/packages/hydrooj/src/model/contest.ts index 122a04f98..a8fe73f6b 100644 --- a/packages/hydrooj/src/model/contest.ts +++ b/packages/hydrooj/src/model/contest.ts @@ -70,9 +70,9 @@ export function isExtended(tdoc: Tdoc) { return tdoc.penaltySince.getTime() <= now && now < tdoc.endAt.getTime(); } -function buildContestRule(def: Optional, 'applyProjection'>): ContestRule; -function buildContestRule(def: Partial>, baseRule: ContestRule): ContestRule; -function buildContestRule(def: Partial>, baseRule: ContestRule = {} as any) { +export function buildContestRule(def: Optional, 'applyProjection'>): ContestRule; +export function buildContestRule(def: Partial>, baseRule: ContestRule): ContestRule; +export function buildContestRule(def: Partial>, baseRule: ContestRule = {} as any) { const base = baseRule._originalRule || { applyProjection: (_, rdoc) => rdoc }; const funcs = ['scoreboard', 'scoreboardRow', 'scoreboardHeader', 'stat', 'applyProjection']; const f = {};