og-statistics 2.0.1 → 2.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 +18 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "og-statistics",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -102,17 +102,28 @@ function filterStats(statsBase, keys = def, fallback = 0) {
102
102
  card
103
103
  */
104
104
 
105
- function filterIncidents(incidents, side = false) {
105
+ function filterIncidents(incidents) {
106
106
  try {
107
107
 
108
- const cards = filterCards(incidents.incidents, side);
109
- const goals = filterGoals(incidents.incidents, side);
110
- const subs = filterSubs(incidents.incidents, side);
108
+ const home_cards = filterCards(incidents.incidents, true);
109
+ const home_goals = filterGoals(incidents.incidents, true);
110
+ const home_subs = filterSubs(incidents.incidents, true);
111
+
112
+ const away_cards = filterCards(incidents.incidents, false);
113
+ const away_goals = filterGoals(incidents.incidents, false);
114
+ const away_subs = filterSubs(incidents.incidents, false);
111
115
 
112
116
  return {
113
- cards,
114
- goals,
115
- subs
117
+ home: {
118
+ cards: home_cards,
119
+ goals: home_goals,
120
+ subs: home_subs
121
+ },
122
+ away: {
123
+ cards: away_cards,
124
+ goals: away_goals,
125
+ subs: away_subs
126
+ }
116
127
  }
117
128
 
118
129
  } catch (error) {