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.
- package/package.json +1 -1
- package/src/index.js +18 -7
package/package.json
CHANGED
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
|
|
105
|
+
function filterIncidents(incidents) {
|
|
106
106
|
try {
|
|
107
107
|
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
const
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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) {
|