Commit c97bad9d authored by nanahira's avatar nanahira

fix plus sign split

parent 4d71b94e
Pipeline #38169 passed with stages
in 2 minutes and 31 seconds
...@@ -25,14 +25,14 @@ class Match { ...@@ -25,14 +25,14 @@ class Match {
this.round = obj.round; this.round = obj.round;
this.isThirdPlaceMatch = obj.isThirdPlaceMatch; this.isThirdPlaceMatch = obj.isThirdPlaceMatch;
this.status = obj.status; this.status = obj.status;
const name1 = obj.player1?.name.split('+') ?? []; const name1 = obj.player1?.name.split(/[\+\uFF0B]/) ?? [];
this.player1 = { this.player1 = {
id : obj.player1Id, id : obj.player1Id,
name : (name1.length == 2 && !Number.isNaN(name1[0]) && name1[0].length > 3) ? name1[1] : obj.player1?.name ?? '', name : (name1.length == 2 && !Number.isNaN(name1[0]) && name1[0].length > 3) ? name1[1] : obj.player1?.name ?? '',
fullName : obj.player1?.name ?? '', fullName : obj.player1?.name ?? '',
score : obj.player1Score score : obj.player1Score
}; };
const name2 = obj.player2?.name.split('+') ?? []; const name2 = obj.player2?.name.split(/[\+\uFF0B]/) ?? [];
this.player2 = { this.player2 = {
id : obj.player2Id, id : obj.player2Id,
name : (name2.length == 2 && !Number.isNaN(name2[0]) && name2[0].length > 3) ? name2[1] : obj.player2?.name ?? '', name : (name2.length == 2 && !Number.isNaN(name2[0]) && name2[0].length > 3) ? name2[1] : obj.player2?.name ?? '',
......
...@@ -14,7 +14,7 @@ class Participant { ...@@ -14,7 +14,7 @@ class Participant {
constructor(obj: ParticipantObject) { constructor(obj: ParticipantObject) {
this.fullName = obj.name; this.fullName = obj.name;
const name = obj.name.split('+'); const name = obj.name.split(/[\+\uFF0B]/);
this.name = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[1] : obj.name; this.name = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[1] : obj.name;
this.tournamentId = obj.tournamentId; this.tournamentId = obj.tournamentId;
this.id = obj.id; this.id = obj.id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment