Verbessere die Altersklassenerkennung in der Funktion sideMatchesJugendTeam durch Verwendung eines regulären Ausdrucks zur genauen Übereinstimmung
This commit is contained in:
@@ -66,8 +66,8 @@ function parseJugendTeamKey(teamKey) {
|
|||||||
|
|
||||||
function sideMatchesJugendTeam({ isHarheimer, ageClass, teamNumber }, team) {
|
function sideMatchesJugendTeam({ isHarheimer, ageClass, teamNumber }, team) {
|
||||||
if (!isHarheimer) return false
|
if (!isHarheimer) return false
|
||||||
const agePattern = new RegExp(`(?:jugend\\s*|j)${team.age}\\b`, 'i')
|
const ageMatch = String(ageClass || '').match(/(?:jugend\s*|j)(\d{1,2})\b/i)
|
||||||
if (!agePattern.test(ageClass)) return false
|
if (!ageMatch || ageMatch[1] !== team.age) return false
|
||||||
return !team.teamNumber || String(teamNumber || '').trim() === team.teamNumber
|
return !team.teamNumber || String(teamNumber || '').trim() === team.teamNumber
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user