overtime-utils 0.2.22 → 0.2.24
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/main.js +1 -1
- package/package.json +1 -1
- package/src/constants/marketTypes.ts +2 -2
- package/src/types/sgp.ts +1 -0
- package/src/utils/markets.ts +24 -18
package/package.json
CHANGED
|
@@ -996,7 +996,7 @@ export const FIRST_PERIOD_MARKET_TYPES = [
|
|
|
996
996
|
MarketType.FIRST_PERIOD_BOTH_TEAMS_TO_SCORE,
|
|
997
997
|
MarketType.FIRST_PERIOD_DRAW_NO_BET,
|
|
998
998
|
MarketType.FIRST_PERIOD_TOTAL_EXACT_HOME_TEAM,
|
|
999
|
-
MarketType.
|
|
999
|
+
MarketType.FIRST_PERIOD_TOTAL_EXACT_AWAY_TEAM,
|
|
1000
1000
|
MarketType.FIRST_PERIOD_TOTAL_CORNERS,
|
|
1001
1001
|
MarketType.FIRST_PERIOD_TOTAL_CORNERS_HOME_TEAM,
|
|
1002
1002
|
MarketType.FIRST_PERIOD_TOTAL_CORNERS_AWAY_TEAM,
|
|
@@ -1094,7 +1094,7 @@ export const SECOND_PERIOD_MARKET_TYPES = [
|
|
|
1094
1094
|
MarketType.SECOND_PERIOD_BOTH_TEAMS_TO_SCORE,
|
|
1095
1095
|
MarketType.SECOND_PERIOD_DRAW_NO_BET,
|
|
1096
1096
|
MarketType.SECOND_PERIOD_TOTAL_EXACT_HOME_TEAM,
|
|
1097
|
-
MarketType.
|
|
1097
|
+
MarketType.SECOND_PERIOD_TOTAL_EXACT_AWAY_TEAM,
|
|
1098
1098
|
MarketType.SECOND_PERIOD_TOTAL_CORNERS,
|
|
1099
1099
|
MarketType.SECOND_PERIOD_TOTAL_CORNERS_HOME_TEAM,
|
|
1100
1100
|
MarketType.SECOND_PERIOD_TOTAL_CORNERS_AWAY_TEAM,
|
package/src/types/sgp.ts
CHANGED
package/src/utils/markets.ts
CHANGED
|
@@ -212,7 +212,7 @@ const validateMarketsWithSameDirection = (markets: SgpBlockerMarket[], sgpBlocke
|
|
|
212
212
|
const playerId = market.playerId;
|
|
213
213
|
const position = market.position;
|
|
214
214
|
|
|
215
|
-
const otherMarkets = markets.filter((_, i) => i !== index);
|
|
215
|
+
const otherMarkets = markets.filter((_, i) => i !== index && markets[i].gameId === market.gameId);
|
|
216
216
|
const isSameMarketDirection = otherMarkets.some(
|
|
217
217
|
(otherMarket) =>
|
|
218
218
|
(!blocker.sport || blocker.sport === sport) &&
|
|
@@ -247,22 +247,28 @@ const validateSomeBlockerWithSomeCombined = (markets: SgpBlockerMarket[], sgpBlo
|
|
|
247
247
|
const blocker = getBlocker(blockers, BLOCKER_GROUP, blockerIndex);
|
|
248
248
|
|
|
249
249
|
if (blocker && blocker.enabled) {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
);
|
|
256
|
-
const hasSomeCombined = markets.some(
|
|
257
|
-
(market) =>
|
|
250
|
+
for (let index = 0; index < markets.length; index++) {
|
|
251
|
+
const market = markets[index];
|
|
252
|
+
const otherMarkets = markets.filter((_, i) => i !== index && markets[i].gameId === market.gameId);
|
|
253
|
+
|
|
254
|
+
const hasSomeBlocker =
|
|
258
255
|
(!blocker.sport || blocker.sport === getLeagueSport(market.leagueId)) &&
|
|
259
256
|
(!blocker.leagueId || blocker.leagueId === market.leagueId) &&
|
|
260
|
-
blocker.
|
|
261
|
-
);
|
|
257
|
+
blocker.blockerTypeIds.includes(market.typeId);
|
|
262
258
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
259
|
+
if (hasSomeBlocker) {
|
|
260
|
+
const hasSomeCombined = otherMarkets.some(
|
|
261
|
+
(otherMarket) =>
|
|
262
|
+
(!blocker.sport || blocker.sport === getLeagueSport(otherMarket.leagueId)) &&
|
|
263
|
+
(!blocker.leagueId || blocker.leagueId === otherMarket.leagueId) &&
|
|
264
|
+
blocker.combineWithTypeIds.includes(otherMarket.typeId)
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
if (hasSomeCombined) {
|
|
268
|
+
message = blocker?.message || getBlockerMessage(BLOCKER_GROUP, blockerIndex);
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
266
272
|
}
|
|
267
273
|
}
|
|
268
274
|
}
|
|
@@ -284,7 +290,7 @@ const validatePlayerPropsCombinations = (markets: SgpBlockerMarket[], sgpBlocker
|
|
|
284
290
|
if (blocker && blocker.enabled) {
|
|
285
291
|
for (let marketIndex = 0; marketIndex < markets.length; marketIndex++) {
|
|
286
292
|
const market = markets[marketIndex];
|
|
287
|
-
const otherMarkets = markets.filter((_, i) => i !== marketIndex);
|
|
293
|
+
const otherMarkets = markets.filter((_, i) => i !== marketIndex && markets[i].gameId === market.gameId);
|
|
288
294
|
|
|
289
295
|
const hasBlockerTypeId =
|
|
290
296
|
(!blocker.sport || blocker.sport === getLeagueSport(market.leagueId)) &&
|
|
@@ -325,7 +331,7 @@ const validateSomeBlockerWithSomeCombinedForSamePosition = (markets: SgpBlockerM
|
|
|
325
331
|
if (blocker && blocker.enabled) {
|
|
326
332
|
for (let marketIndex = 0; marketIndex < markets.length; marketIndex++) {
|
|
327
333
|
const market = markets[marketIndex];
|
|
328
|
-
const otherMarkets = markets.filter((_, i) => i !== marketIndex);
|
|
334
|
+
const otherMarkets = markets.filter((_, i) => i !== marketIndex && markets[i].gameId === market.gameId);
|
|
329
335
|
|
|
330
336
|
const hasBlockerTypeId =
|
|
331
337
|
(!blocker.sport || blocker.sport === getLeagueSport(market.leagueId)) &&
|
|
@@ -369,7 +375,7 @@ const validateSomeBlockerWithEveryCombinedForSamePosition = (
|
|
|
369
375
|
if (blocker && blocker.enabled) {
|
|
370
376
|
for (let marketIndex = 0; marketIndex < markets.length; marketIndex++) {
|
|
371
377
|
const market = markets[marketIndex];
|
|
372
|
-
const otherMarkets = markets.filter((_, i) => i !== marketIndex);
|
|
378
|
+
const otherMarkets = markets.filter((_, i) => i !== marketIndex && markets[i].gameId === market.gameId);
|
|
373
379
|
|
|
374
380
|
const hasBlockerTypeId =
|
|
375
381
|
(!blocker.sport || blocker.sport === getLeagueSport(market.leagueId)) &&
|
|
@@ -413,7 +419,7 @@ const validateSomeBlockerWithEveryCombined = (markets: SgpBlockerMarket[], sgpBl
|
|
|
413
419
|
if (blocker && blocker.enabled) {
|
|
414
420
|
for (let marketIndex = 0; marketIndex < markets.length; marketIndex++) {
|
|
415
421
|
const market = markets[marketIndex];
|
|
416
|
-
const otherMarkets = markets.filter((_, i) => i !== marketIndex);
|
|
422
|
+
const otherMarkets = markets.filter((_, i) => i !== marketIndex && markets[i].gameId === market.gameId);
|
|
417
423
|
|
|
418
424
|
const hasBlockerTypeId =
|
|
419
425
|
(!blocker.sport || blocker.sport === getLeagueSport(market.leagueId)) &&
|