og-statistics 3.0.1 → 3.0.3

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/package.json +1 -1
  2. package/src/index.js +4 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "og-statistics",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -137,7 +137,6 @@ function filterIncidents(incidents) {
137
137
  }
138
138
  }
139
139
 
140
-
141
140
  const CARD_CLASSES = ['red', 'yellow', 'yellowRed'];
142
141
 
143
142
  const filterCards = (incidents, isHome) => {
@@ -157,7 +156,7 @@ const filterCards = (incidents, isHome) => {
157
156
  return acc;
158
157
  }, {});
159
158
 
160
- cards.fulltime = teamIncidents;
159
+ cards.timelapse = teamIncidents;
161
160
 
162
161
  return cards;
163
162
  };
@@ -175,7 +174,7 @@ const filterGoals = (incidents, isHome) => {
175
174
  return acc
176
175
  }, {});
177
176
 
178
- goles.full = teamIncidents;
177
+ goles.timelapse = teamIncidents;
179
178
  return goles;
180
179
  };
181
180
 
@@ -189,10 +188,9 @@ function filterSubs(incidents, isHome) {
189
188
  }
190
189
  }
191
190
 
192
-
193
191
  function goalSummary(incidentsData, windowMinutes = 15) {
194
192
  try {
195
- const { local = [], away = [] } = incidentsData;
193
+ const { home = [], away = [] } = incidentsData;
196
194
 
197
195
  // Normaliza goles de cada lado
198
196
  function extractGoals(events, teamLabel) {
@@ -206,7 +204,7 @@ function goalSummary(incidentsData, windowMinutes = 15) {
206
204
  }));
207
205
  }
208
206
 
209
- const homeGoals = extractGoals(local, 'home');
207
+ const homeGoals = extractGoals(home, 'home');
210
208
  const awayGoals = extractGoals(away, 'away');
211
209
  const goals = [...homeGoals, ...awayGoals].sort((a, b) => a.time - b.time);
212
210
 
@@ -439,5 +437,4 @@ function goalSummary(incidentsData, windowMinutes = 15) {
439
437
  }
440
438
  }
441
439
 
442
-
443
440
  module.exports = { filterStats, filterIncidents, goalSummary };