utils/parsers

utils/parsers

Methods

(static) exports.getDateTime(dateString) → {object}

Source:

Parse date in format DD/MM/YYYY, time in format hh:mm and seconds in format ss

Example
2020-04-27T09:18:02Z
parsed to {
 date: "27/04/2020"
 time: "09:18"
 seconds: "02"
}
Parameters:
Name Type Description
dateString Time
Returns:

Parsed date and time

Type
object

(static) exports.getPlacedBetsResults(selections, markets) → {object}

Source:

Parse placed bets. One selection code skelet leagueId:matchIndex:selectionId:oddValue

Parameters:
Name Type Description
selections Array
markets Array
Returns:
Type
object

(static) exports.parseBigNums(bigNum) → {string}

Source:

Set flag enable on markets

Parameters:
Name Type Description
bigNum number
Returns:
Type
string

(static) exports.parseCompetitors(matchString) → {Array}

Source:

Get team names from match

Parameters:
Name Type Description
matchString string
Returns:
Type
Array

(static) exports.parseMarkets(markets, correctScoreIndex) → {Array}

Source:

Adding index as market.id in markets array

Parameters:
Name Type Description
markets Array
correctScoreIndex number
Returns:
Type
Array

(static) exports.parseMatches(matchesString) → {Array}

Source:

Parse matches

Parameters:
Name Type Description
matchesString string
Returns:
Type
Array

(static) exports.parseNum(value) → {string}

Source:

Parse number as currency. For example 9,999,999

Parameters:
Name Type Description
value number
Returns:
Type
string

(static) exports.parseOdds(odds, activeSelections) → {object}

Source:

Parse odds

Parameters:
Name Type Description
odds Array
activeSelections Array.<string>
Returns:
Type
object

(static) exports.parsePlacedSelections(currentSelections, newPlacedSelections, markets) → {object}

Source:

Adding new placed selection in object of placed selections

Parameters:
Name Type Description
currentSelections object
newPlacedSelections object
markets Array
Returns:
Type
object

(static) exports.parseSelectedMarket(market) → {object}

Source:

Parse selected market

Parameters:
Name Type Description
market Array
Returns:
Type
object

(static) exports.parseTeamStatistic(teamsTableString) → {Array}

Source:

Parse League Table statistic

Parameters:
Name Type Description
teamsTableString string
Returns:
Type
Array

(static) exports.parseTicketData(bets, markets, prevBets, selectedTicket, prevDates, updTickets) → {object}

Source:

Parsed tickets list per date

Parameters:
Name Type Description
bets Array
markets Array
prevBets object
selectedTicket object
prevDates Array
updTickets boolean
Returns:
Type
object

(static) exports.parseTimeline(timelineString) → {object}

Source:

Parse timeline into minutes for one league

Parameters:
Name Type Description
timelineString string
Returns:
Type
object

(static) exports.parseTimelineResults(minuteString, leagueIndex, showBlink, placedSelectionsLive, blink, scores, blinksForRemove) → {object}

Source:

Seting placed selection changes, scores and blink data

Parameters:
Name Type Description
minuteString string
leagueIndex number
showBlink boolean
placedSelectionsLive object
blink object
scores object
blinksForRemove Array
Returns:
Type
object

(static) exports.parseTurboTimeline(timelineString) → {object}

Source:

Parse timeline into minutes for one league 0: "0:0&3:1&0:6&1:1&1:0&0:0&1:2&1:2&2:1&1:0"

Parameters:
Name Type Description
timelineString string
Returns:
Type
object

(static) exports.roundNum(value) → {string}

Source:

Round number up and add 0.000001 to avoid js errors

Parameters:
Name Type Description
value number
Returns:
Type
string

(static) exports.setActiveMarkets(markets, odds) → {object}

Source:

Set flag enable on markets

Parameters:
Name Type Description
markets Array
odds object

Odds of first match of selected league

Returns:
Type
object

(static) findSelection(selections, odds) → {boolean}

Source:

Check if any selection exist in odds

Parameters:
Name Type Description
selections object
odds object
Returns:
Type
boolean

(static) parseBets(betData, betDetail, markets) → {object}

Source:
See:

Parse ticket bets.

Parameters:
Name Type Description
betData string

[bet_type|leagueId:matchIndex:selectionId|stake -ex: "2|2:6:133$3:1:128|20000" ], combination stake [ -ex: "3|1:3:102$1:4:102$1:5:102|2:200&3:500&4:1000&T:310000" ]

betDetail string

[match:odd:score:win/lost$another_match|minOdd-maxOdd|winnings -ex: "ABC-DEF:2.15:0-1:1$GHI-JKL:1.85:2-1:1|1.85-11.63|1:64000&2:380000" ],

markets Array
Returns:
Type
object