@claudinho/core 0.8.14 → 0.8.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +20 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3422,7 +3422,7 @@ function winnerLabel(ctx, stage, index) {
3422
3422
  n: String(index)
3423
3423
  });
3424
3424
  }
3425
- function resolveSlot(ref, ctx, liveTeam) {
3425
+ function resolveSlot(ref, ctx, liveTeam, fixtureInMergedSet = false) {
3426
3426
  const liveParticipant = confirmedLiveParticipant(liveTeam);
3427
3427
  switch (ref.kind) {
3428
3428
  case "seed":
@@ -3444,23 +3444,27 @@ function resolveSlot(ref, ctx, liveTeam) {
3444
3444
  if (liveParticipant) return liveParticipant;
3445
3445
  return tbd(t(ctx.lang, "bracket.slot.third", { groups: ref.groups.join("/") }));
3446
3446
  case "winner": {
3447
- const node = ctx.nodesByKey.get(matchKey(ref.stage, ref.index));
3448
- const match = node ? ctx.matchesById.get(node.matchId) : void 0;
3449
- if (match) {
3450
- const winner = resolveWinner(match);
3451
- if (winner) return participant(winner, "confirmed");
3452
- }
3453
3447
  if (liveParticipant) return liveParticipant;
3448
+ if (!fixtureInMergedSet) {
3449
+ const node = ctx.nodesByKey.get(matchKey(ref.stage, ref.index));
3450
+ const match = node ? ctx.matchesById.get(node.matchId) : void 0;
3451
+ if (match) {
3452
+ const winner = resolveWinner(match);
3453
+ if (winner) return participant(winner, "confirmed");
3454
+ }
3455
+ }
3454
3456
  return tbd(winnerLabel(ctx, ref.stage, ref.index));
3455
3457
  }
3456
3458
  case "loser": {
3457
- const node = ctx.nodesByKey.get(matchKey(ref.stage, ref.index));
3458
- const match = node ? ctx.matchesById.get(node.matchId) : void 0;
3459
- if (match) {
3460
- const loser = resolveLoser(match);
3461
- if (loser) return participant(loser, "confirmed");
3462
- }
3463
3459
  if (liveParticipant) return liveParticipant;
3460
+ if (!fixtureInMergedSet) {
3461
+ const node = ctx.nodesByKey.get(matchKey(ref.stage, ref.index));
3462
+ const match = node ? ctx.matchesById.get(node.matchId) : void 0;
3463
+ if (match) {
3464
+ const loser = resolveLoser(match);
3465
+ if (loser) return participant(loser, "confirmed");
3466
+ }
3467
+ }
3464
3468
  return tbd(
3465
3469
  t(ctx.lang, "bracket.slot.loser", {
3466
3470
  stage: stageLabelI18n(ctx.lang, ref.stage),
@@ -3483,6 +3487,7 @@ function buildBracketView(topology, matches, tables, standingsDegraded, liveDegr
3483
3487
  if (want && stage !== want) continue;
3484
3488
  const nodes = topology.matches.filter((n) => n.stage === stage);
3485
3489
  const matchViews = nodes.map((node) => {
3490
+ const fixtureInMergedSet = matchesById.has(node.matchId);
3486
3491
  const match = matchesById.get(node.matchId) ?? {
3487
3492
  id: node.matchId,
3488
3493
  stage: node.stage,
@@ -3498,8 +3503,8 @@ function buildBracketView(topology, matches, tables, standingsDegraded, liveDegr
3498
3503
  stage: node.stage,
3499
3504
  index: node.index,
3500
3505
  kickoff: match.kickoff,
3501
- home: resolveSlot(node.home, ctx, match.home),
3502
- away: resolveSlot(node.away, ctx, match.away),
3506
+ home: resolveSlot(node.home, ctx, match.home, fixtureInMergedSet),
3507
+ away: resolveSlot(node.away, ctx, match.away, fixtureInMergedSet),
3503
3508
  match
3504
3509
  };
3505
3510
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudinho/core",
3
- "version": "0.8.14",
3
+ "version": "0.8.16",
4
4
  "description": "Domain model, provider adapters (ESPN), standings, bundled schedule, and the read-only Polymarket market-signal sidecar powering Claudinho. Not affiliated with FIFA or Anthropic.",
5
5
  "type": "module",
6
6
  "license": "MIT",