overtime-utils 0.0.13 → 0.0.15

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.
@@ -226,3 +226,11 @@ export enum PeriodType {
226
226
  MAP = 'map',
227
227
  EMPTY = '',
228
228
  }
229
+
230
+ export enum Provider {
231
+ EMPTY = '',
232
+ RUNDOWN = 'rundown',
233
+ ENETPULSE = 'enetpulse',
234
+ JSONODDS = 'jsonOdds',
235
+ OPTICODDS = 'opticOdds',
236
+ }
@@ -1,9 +1,11 @@
1
- import { League, MatchResolveType, PeriodType, ScoringType, Sport } from '../enums/sports';
1
+ import { League, MatchResolveType, PeriodType, Provider, ScoringType, Sport } from '../enums/sports';
2
2
 
3
3
  export type LeagueInfo = {
4
4
  sport: Sport;
5
5
  id: League;
6
6
  label: string;
7
+ opticOddsName?: string;
8
+ provider: Provider;
7
9
  logo?: string;
8
10
  logoClass?: string;
9
11
  scoringType: ScoringType;
@@ -1,13 +1,20 @@
1
1
  import {
2
+ AWAY_TEAM_MARKET_TYPES,
2
3
  AWAY_TEAM_TOTAL_MARKET_TYPES,
3
4
  BOTH_TEAMS_TO_SCORE_MARKET_TYPES,
5
+ CARDS_MARKET_TYPES,
4
6
  COMBINED_POSITIONS_MARKET_TYPES,
7
+ CORNERS_MARKET_TYPES,
5
8
  CORRECT_SCORE_MARKET_TYPES,
9
+ DOUBLE_CHANCE_MARKET_TYPES,
6
10
  FUTURES_MARKET_TYPES,
11
+ HOME_TEAM_MARKET_TYPES,
7
12
  HOME_TEAM_TOTAL_MARKET_TYPES,
8
13
  ONE_SIDE_PLAYER_PROPS_MARKET_TYPES,
9
14
  OTHER_YES_NO_MARKET_TYPES,
15
+ PERIOD_MARKET_TYPES,
10
16
  PLAYER_PROPS_MARKET_TYPES,
17
+ SCORE_MARKET_TYPES,
11
18
  SGP_NOT_SUPPORTED_MARKET_TYPES,
12
19
  SPREAD_MARKET_TYPES,
13
20
  TOTAL_EXACT_MARKET_TYPES,
@@ -59,13 +66,46 @@ export const isBothTeamsToScoreMarket = (marketType: MarketType) =>
59
66
 
60
67
  export const isOtherYesNoMarket = (marketType: MarketType) => OTHER_YES_NO_MARKET_TYPES.includes(marketType);
61
68
 
69
+ export const isDoubleChanceMarket = (marketType: MarketType) => DOUBLE_CHANCE_MARKET_TYPES.includes(marketType);
70
+
62
71
  export const isCorrectScoreMarket = (marketType: MarketType) => CORRECT_SCORE_MARKET_TYPES.includes(marketType);
63
72
 
73
+ export const isDrawAvailableMarket = (marketType: MarketType) =>
74
+ WINNER_MARKET_TYPES.includes(marketType) || SCORE_MARKET_TYPES.includes(marketType);
75
+
76
+ export const isPeriodMarket = (marketType: MarketType) => PERIOD_MARKET_TYPES.includes(marketType);
77
+
78
+ export const isPeriod2Market = (marketType: MarketType) => {
79
+ return (
80
+ (marketType >= MarketType.FIRST_PERIOD_WINNER2 && marketType <= MarketType.NINTH_PERIOD_WINNER2) ||
81
+ (marketType >= MarketType.FIRST_PERIOD_TOTAL2 && marketType <= MarketType.NINTH_PERIOD_TOTAL2) ||
82
+ (marketType >= MarketType.FIRST_PERIOD_SPREAD2 && marketType <= MarketType.NINTH_PERIOD_SPREAD2) ||
83
+ (marketType >= MarketType.FIRST_PERIOD_TOTAL2_ODD_EVEN &&
84
+ marketType <= MarketType.NINTH_PERIOD_TOTAL2_ODD_EVEN) ||
85
+ (marketType >= MarketType.FIRST_PERIOD_TOTAL2_HOME_TEAM &&
86
+ marketType <= MarketType.FIRST_PERIOD_TOTAL2_AWAY_TEAM) ||
87
+ (marketType >= MarketType.SECOND_PERIOD_TOTAL2_HOME_TEAM &&
88
+ marketType <= MarketType.SECOND_PERIOD_TOTAL2_AWAY_TEAM)
89
+ );
90
+ };
91
+
92
+ export const isHomeTeamMarket = (marketType: MarketType) => HOME_TEAM_MARKET_TYPES.includes(marketType);
93
+
94
+ export const isAwayTeamMarket = (marketType: MarketType) => AWAY_TEAM_MARKET_TYPES.includes(marketType);
95
+
96
+ export const isScoreMarket = (marketType: MarketType) => SCORE_MARKET_TYPES.includes(marketType);
97
+
98
+ export const isOnlyOverPlayerPropsMarket = (marketType: MarketType, odds: number[]) =>
99
+ isPlayerPropsMarket(marketType) && odds.length === 1;
100
+
64
101
  export const isUfcSpecificMarket = (marketType: MarketType) => UFC_SPECIFIC_MARKET_TYPES.includes(marketType);
65
102
  export const isUfcWinningMarket = (marketType: MarketType) => UFC_WINNING_ROUND_MARKET_TYPES.includes(marketType);
66
103
  export const isEndingUfcMarket = (marketType: MarketType) => UFC_ENDING_METHOD_MARKET_TYPES.includes(marketType);
67
104
  export const isUfcVictoryMarket = (marketType: MarketType) => UFC_METHOD_OF_VICTORY_MARKET_TYPES.includes(marketType);
68
105
 
106
+ export const isContractResultView = (marketType: MarketType) =>
107
+ CORNERS_MARKET_TYPES.includes(marketType) || CARDS_MARKET_TYPES.includes(marketType);
108
+
69
109
  export const isTotalOrSpreadWithWholeLine = (marketType: MarketType, line: number) =>
70
110
  (isTotalMarket(marketType) || isSpreadMarket(marketType)) && line % 1 === 0;
71
111