overtime-live-trading-utils 0.0.78 → 0.0.80
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/package.json +1 -1
- package/src/utils/odds.ts +5 -5
package/package.json
CHANGED
package/src/utils/odds.ts
CHANGED
|
@@ -301,7 +301,7 @@ export const formatSpreadOdds = (
|
|
|
301
301
|
typeId,
|
|
302
302
|
defaultSpreadForLiveMarkets
|
|
303
303
|
) => {
|
|
304
|
-
const validSpreadOdds = spreadOdds.filter((odd) => odd && Math.abs(odd.selection_points % 1) === 0.5);
|
|
304
|
+
const validSpreadOdds = spreadOdds.filter((odd) => odd && Math.abs(odd.selection_points % 1) === 0.5) as any;
|
|
305
305
|
|
|
306
306
|
const formattedSpreadOdds = groupAndFormatSpreadOdds(validSpreadOdds, commonData);
|
|
307
307
|
|
|
@@ -394,7 +394,7 @@ export const formatSpreadOdds = (
|
|
|
394
394
|
*/
|
|
395
395
|
export const groupAndFormatSpreadOdds = (oddsArray, commonData) => {
|
|
396
396
|
// Group odds by their selection points and selection
|
|
397
|
-
const groupedOdds = oddsArray.reduce((acc, odd) => {
|
|
397
|
+
const groupedOdds = oddsArray.reduce((acc: any, odd: any) => {
|
|
398
398
|
const { selection_points, price, selection } = odd;
|
|
399
399
|
const isHomeTeam = selection === commonData.homeTeam;
|
|
400
400
|
|
|
@@ -411,13 +411,13 @@ export const groupAndFormatSpreadOdds = (oddsArray, commonData) => {
|
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
return acc;
|
|
414
|
-
}, {});
|
|
414
|
+
}, {}) as any;
|
|
415
415
|
// Format the grouped odds into the desired output
|
|
416
|
-
const formattedOdds = Object.entries(groupedOdds).reduce((acc, [key, value]) => {
|
|
416
|
+
const formattedOdds = Object.entries(groupedOdds as any).reduce((acc, [key, value]) => {
|
|
417
417
|
const line = parseFloat(key);
|
|
418
418
|
if ((value as any).home !== null && (value as any).away !== null) {
|
|
419
419
|
acc.push({
|
|
420
|
-
line,
|
|
420
|
+
line: line as any,
|
|
421
421
|
odds: [(value as any).home, (value as any).away],
|
|
422
422
|
});
|
|
423
423
|
}
|