123456789101112131415161718192021222324 |
- import { normalize } from '../helpers.js'
- /** Class representing a match */
- class Match {
- /**
- * Create a match
- * A match data item in the Swisstennis Calendar.xlsx file has the following columns
- * Ort | Datum | Zeit | Konkurrenz | Spieler 1 | Spieler 1 Klassierung | Spieler 2 |
- * Spieler 2 Klassierung | [Resultat]
- */
- constructor (data) {
- this.Ort = normalize(data[0])
- this.Datum = data[1]
- this.Konkurrenz = normalize(data[3])
- this.Spieler1 = normalize(data[4])
- this.Spieler1Klassierung = normalize(data[5])
- this.Spieler2 = normalize(data[6])
- this.Spieler2Klassierung = normalize(data[7])
- this.Resultat = normalize(data[8] || null)
- this.isDoubles = this.Konkurrenz.match(/DM.*|[MW]D.*/)
- }
- }
- export default { Match }
|