overtime-live-trading-utils 4.0.0-rc.3 → 4.0.0-rc.6
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/utils/odds.ts +12 -17
package/package.json
CHANGED
package/src/utils/odds.ts
CHANGED
|
@@ -475,16 +475,16 @@ export const groupAndFormatTotalOdds = (oddsArray: any[], commonData: HomeAwayTe
|
|
|
475
475
|
// if we have away team in total odds we know the market is team total and we need to increase typeId by one.
|
|
476
476
|
// if this is false typeId is already mapped correctly
|
|
477
477
|
const shouldIncreaseTypeId = selection === commonData.awayTeam && !(value as any).playerProps;
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
478
|
+
|
|
479
|
+
acc.push({
|
|
480
|
+
line: line as any,
|
|
481
|
+
odds: [(value as any).over, (value as any).under].filter((odd) => odd !== null),
|
|
482
|
+
typeId: !shouldIncreaseTypeId ? (value as any).typeId : Number((value as any).typeId) + 1,
|
|
483
|
+
sportId: (value as any).sportId,
|
|
484
|
+
type: (value as any).type,
|
|
485
|
+
playerProps: (value as any).playerProps,
|
|
486
|
+
});
|
|
487
|
+
|
|
488
488
|
return acc;
|
|
489
489
|
}, []);
|
|
490
490
|
|
|
@@ -943,13 +943,8 @@ export const adjustSpreadOnChildOdds = (
|
|
|
943
943
|
) => {
|
|
944
944
|
const result: any[] = [];
|
|
945
945
|
iterableGroupedOdds.forEach((data) => {
|
|
946
|
-
const
|
|
947
|
-
const
|
|
948
|
-
const awayTeamOdds = convertOddsToImpl(data.odds[1]) || ZERO;
|
|
949
|
-
const drawOdds = convertOddsToImpl(data.odds[2]) || ZERO;
|
|
950
|
-
const odds = hasDrawOdds ? [homeTeamOdds, awayTeamOdds, drawOdds] : [homeTeamOdds, awayTeamOdds];
|
|
951
|
-
|
|
952
|
-
const isZeroOddsChild = homeTeamOdds === ZERO || awayTeamOdds === ZERO || (hasDrawOdds && drawOdds === ZERO);
|
|
946
|
+
const odds = data.odds.map((odd: number) => convertOddsToImpl(odd) || ZERO);
|
|
947
|
+
const isZeroOddsChild = odds.includes(ZERO);
|
|
953
948
|
if (!isZeroOddsChild) {
|
|
954
949
|
const spreadData = getSpreadData(
|
|
955
950
|
spreadDataForSport,
|