6060
6161-- Default body function
6262--- @param match MatchGroupUtilMatch
63- --- @param createGames fun ( match : MatchGroupUtilMatch ): Renderable | Renderable[] ?
64- --- @param createGame fun ( date : string , game : table , gameIndex : integer ): Renderable | Renderable[]
63+ --- @param createGames ? fun ( match : MatchGroupUtilMatch ): Renderable | Renderable[] ?
64+ --- @param createGame ? fun ( date : string , game : table , gameIndex : integer ): Renderable | Renderable[]
6565--- @param options { maxBans : integer ?}?
6666--- @return Renderable[]
6767function MatchSummary .createDefaultBody (match , createGames , createGame , options )
@@ -70,6 +70,8 @@ function MatchSummary.createDefaultBody(match, createGames, createGame, options)
7070 local characterBansData = MatchSummary .buildCharacterBanData (match .games , options .maxBans or 0 )
7171
7272 return WidgetUtil .collect (
73+ --- we assume that createGames and createGame are mutually exclusive, so we can safely call one or the other
74+ --- @diagnostic disable-next-line : param-type-mismatch
7375 createGames and createGames (match ) or Array .map (match .games , FnUtil .curry (createGame , match .date )),
7476 MatchSummaryWidgets .Mvp (match .extradata .mvp ),
7577 MatchSummaryWidgets .MapVeto (MatchSummary .preProcessMapVeto (match .extradata .mapveto , {game = match .game })),
@@ -221,7 +223,7 @@ function MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, options)
221223 type (CustomMatchSummary .createGame ) == ' function' or
222224 type (CustomMatchSummary .createGames ) == ' function'
223225 ),
224- ' createBody or createGame or createGames must be implemented in Module:MatchSummary'
226+ ' One of createBody or createGame or createGames must be implemented in Module:MatchSummary'
225227 )
226228
227229 options = options or {}
0 commit comments