poker-irongrid 1.2.0 → 1.2.1
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.
|
@@ -130,25 +130,14 @@
|
|
|
130
130
|
function normalizeTokens(input) {
|
|
131
131
|
if (!input || !input.trim()) return [];
|
|
132
132
|
const symbolMap = { '♣': 'c', '♦': 'd', '♥': 'h', '♠': 's' };
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
.
|
|
138
|
-
.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
let t = tok.trim();
|
|
142
|
-
t = t.replace(/[♣♦♥♠]/g, (m) => symbolMap[m] || m);
|
|
143
|
-
const rank = t.charAt(0).toUpperCase();
|
|
144
|
-
const suitRaw = t.charAt(1) || '';
|
|
145
|
-
const suit = suitRaw.toLowerCase();
|
|
146
|
-
if (validRanks.has(rank) && validSuits.has(suit)) {
|
|
147
|
-
return rank + suit;
|
|
148
|
-
}
|
|
149
|
-
return null;
|
|
150
|
-
})
|
|
151
|
-
.filter(Boolean);
|
|
133
|
+
const text = input.replace(/[♣♦♥♠]/g, (m) => symbolMap[m]);
|
|
134
|
+
// Cards with or without separators: 'As Ks', 'AsKs', 'A♠K♠', 'as,ks' all give ['As', 'Ks']
|
|
135
|
+
const cards = [];
|
|
136
|
+
for (const [, rank, suit] of text.matchAll(/([AKQJT2-9])([cdhs])/gi)) {
|
|
137
|
+
const card = rank.toUpperCase() + suit.toLowerCase();
|
|
138
|
+
if (!cards.includes(card)) cards.push(card);
|
|
139
|
+
}
|
|
140
|
+
return cards;
|
|
152
141
|
}
|
|
153
142
|
|
|
154
143
|
/**
|
|
@@ -74,7 +74,11 @@
|
|
|
74
74
|
</span>
|
|
75
75
|
</span>
|
|
76
76
|
<div class="flex items-center gap-2">
|
|
77
|
-
{#if
|
|
77
|
+
{#if evaluator && heroCards?.length !== 2 && selected + highlighted > 0}
|
|
78
|
+
<div class="text-xs" style="color: var(--irongrid-color-text-secondary);">
|
|
79
|
+
<span>Enter 2 hero cards for equity</span>
|
|
80
|
+
</div>
|
|
81
|
+
{:else if showEquity}
|
|
78
82
|
<div
|
|
79
83
|
class="text-xs equity-readout"
|
|
80
84
|
class:equity-pending={equityPending}
|