Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
vAlignCenter([
'PG',
{
content: bold(
homeTeamStartingPlayers.filter(
player => player.position.indexOf('G') > -1
)[1].name
),
hAlign: 'left',
},
bold('Team'),
bold('Q1'),
bold('Q2'),
bold('Q3'),
bold('Q4'), // FIXME OT
bold(center('Total', 9)),
'PG',
{
content: bold(
visitorTeamStartingPlayers.filter(
player => player.position.indexOf('G') > -1
)[1].name
),
hAlign: 'left',
},
]),
vAlignCenter([
'SG',
{
content: bold(
homeTeamStartingPlayers.filter(
player => player.position.indexOf('G') > -1
const chooseGameFromSchedule = async (gamesData, option) => {
const spinner = ora(
`Loading Game Schedule...(0/${gamesData.length})`
).start();
let networksHeader = '';
if (option.networks) {
networksHeader = `${padHomeTeamNetwork('Home')} ${emoji.get(
'tv'
)} ${padAwayTeamNetwork('Away')}|`;
}
const header = `│ ${padHomeTeamName('Home')}${center(
emoji.get('basketball'),
8
)}${padVisitorTeamName('Away')}│${center('Score', 11)}│${padGameStatus(
'Status'
)}│${networksHeader}`;
const tableWidth = !option.networks ? MAX_WIDTH : MAX_WIDTH_WITH_NETWORKS;
const questions = [
{
name: 'game',
message: 'Which game do you want to watch?',
type: 'list',
pageSize: 30,
choices: [
new inquirer.Separator(`${limit('', tableWidth, '─')}`),
new inquirer.Separator(header),
new inquirer.Separator(`${limit('', tableWidth, '─')}`),
],
},
choices.push(`│${item.map((item: any, index: number) => {
return center(item, width_rule[heads[index].type])
}).join('│')}│`)
choices.push(new inquire.Separator(`${limit('', tableWidth, '─')}`))
const chooseGameFromSchedule = async (gamesData, option) => {
const spinner = ora(
`Loading Game Schedule...(0/${gamesData.length})`
).start();
let networksHeader = '';
if (option.networks) {
networksHeader = `${padHomeTeamNetwork('Home')} ${emoji.get(
'tv'
)} ${padAwayTeamNetwork('Away')}|`;
}
const header = `│ ${padHomeTeamName('Home')}${center(
emoji.get('basketball'),
8
)}${padVisitorTeamName('Away')}│${center('Score', 11)}│${padGameStatus(
'Status'
)}│${networksHeader}`;
const tableWidth = !option.networks ? MAX_WIDTH : MAX_WIDTH_WITH_NETWORKS;
const questions = [
{
name: 'game',
message: 'Which game do you want to watch?',
type: 'list',
pageSize: 30,
choices: [
new inquirer.Separator(`${limit('', tableWidth, '─')}`),
new inquirer.Separator(header),
const padGameStatus = status => center(status, STATUS_WIDTH);
const padHomeTeamNetwork = network => bold(right(network, NETWORK_WIDTH));
{
colSpan: 16,
content: bold(`${emoji.get('house')} ${arena} | ${city}, ${state}`),
},
]),
alignCenter([
{
colSpan: 16,
content: bold(
`${networks.homeTeam} ${emoji.get('tv')} ${networks.visitorTeam}`
),
},
]),
alignCenter(
createTeamStatsColumns(
center(homeTeam.getFullName({ color: true }), columnMaxWidth),
homeTeamDashboardData
)
),
alignCenter([
'',
bold('RECORD'),
bold('WIN%'),
bold('PTS'),
bold('FG%'),
bold('3P%'),
bold('FT%'),
bold('OREB'),
bold('DREB'),
bold('REB'),
bold('AST'),
bold('BLK'),
const header = `│${heads.map((item: any) => {
return center(yellow(item.value), width_rule[item.type])
}).join('│')}│`
let choices: Array = [