og-statistics 1.0.0 → 2.0.0
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 +7 -14
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -102,24 +102,17 @@ function filterStats(statsBase, keys = def, fallback = 0) {
|
|
|
102
102
|
card
|
|
103
103
|
*/
|
|
104
104
|
|
|
105
|
-
function filterIncidents(incidents) {
|
|
105
|
+
function filterIncidents(incidents, side = false) {
|
|
106
106
|
try {
|
|
107
|
-
//Cards, goals, substitutions
|
|
108
107
|
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
const homeGoals = filterGoals(incidents.incidents, true);
|
|
113
|
-
const awayGoals = filterGoals(incidents.incidents, false);
|
|
114
|
-
|
|
115
|
-
const homeSubs = filterSubs(incidents.incidents, true);
|
|
116
|
-
const awaySubs = filterSubs(incidents.incidents, false);
|
|
108
|
+
const cards = filterCards(incidents.incidents, side);
|
|
109
|
+
const goals = filterGoals(incidents.incidents, side);
|
|
110
|
+
const subs = filterSubs(incidents.incidents, side);
|
|
117
111
|
|
|
118
112
|
return {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
113
|
+
cards,
|
|
114
|
+
goals,
|
|
115
|
+
subs
|
|
123
116
|
}
|
|
124
117
|
|
|
125
118
|
} catch (error) {
|