-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
28 lines (22 loc) · 771 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use strict'
var helper = require('./helper.js');
exports.getLiveScores = function(sport, team1, team2, callback) {
sport = sport.replace("_"," ").toLowerCase().trim();
team1 = team1.replace("_"," ").toLowerCase().trim();
team2 = team2.replace("_"," ").toLowerCase().trim();
switch(sport){
case "cricket":
helper.getCricketScores(team1,team2,callback);
break;
default:
helper.getOthersScores(sport,team1,team2,callback);
}
}
exports.getAllMatches = function(sport,callback) {
sport = sport.replace("_"," ").toLowerCase().trim();
if (sport == "cricket") {
return helper.getAllCricketMatches(callback);
}else{
return helper.getAllOtherMatches(sport,callback);
}
}