Skip to content

Commit

Permalink
Added assists and flashAssists to player stats under match stats (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkeldamm authored and gigobyte committed Jan 5, 2019
1 parent 2600970 commit 941f731
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
60 changes: 60 additions & 0 deletions __tests__/__snapshots__/getMatchStats.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ Object {
Object {
"ADR": 93.3,
"KAST": 80.9,
"assists": 13,
"deaths": 47,
"firstKillsDifference": 4,
"flashAssists": 4,
"hsKills": 24,
"id": 7398,
"killDeathsDifference": 11,
Expand All @@ -69,8 +71,10 @@ Object {
Object {
"ADR": 79.4,
"KAST": 75,
"assists": 13,
"deaths": 34,
"firstKillsDifference": 5,
"flashAssists": 5,
"hsKills": 34,
"id": 9032,
"killDeathsDifference": 18,
Expand All @@ -81,8 +85,10 @@ Object {
Object {
"ADR": 76,
"KAST": 69.1,
"assists": 10,
"deaths": 40,
"firstKillsDifference": 4,
"flashAssists": 3,
"hsKills": 13,
"id": 7592,
"killDeathsDifference": 8,
Expand All @@ -93,8 +99,10 @@ Object {
Object {
"ADR": 71.2,
"KAST": 69.1,
"assists": 15,
"deaths": 40,
"firstKillsDifference": 1,
"flashAssists": 2,
"hsKills": 13,
"id": 7412,
"killDeathsDifference": 1,
Expand All @@ -105,8 +113,10 @@ Object {
Object {
"ADR": 72.1,
"KAST": 67.6,
"assists": 13,
"deaths": 42,
"firstKillsDifference": 0,
"flashAssists": 2,
"hsKills": 12,
"id": 4954,
"killDeathsDifference": -1,
Expand All @@ -119,8 +129,10 @@ Object {
Object {
"ADR": 81.6,
"KAST": 61.8,
"assists": 7,
"deaths": 44,
"firstKillsDifference": -1,
"flashAssists": 2,
"hsKills": 28,
"id": 7998,
"killDeathsDifference": 10,
Expand All @@ -131,8 +143,10 @@ Object {
Object {
"ADR": 71.8,
"KAST": 61.8,
"assists": 9,
"deaths": 48,
"firstKillsDifference": -4,
"flashAssists": 3,
"hsKills": 27,
"id": 7594,
"killDeathsDifference": -4,
Expand All @@ -143,8 +157,10 @@ Object {
Object {
"ADR": 70,
"KAST": 52.9,
"assists": 11,
"deaths": 51,
"firstKillsDifference": -1,
"flashAssists": 3,
"hsKills": 20,
"id": 8918,
"killDeathsDifference": -10,
Expand All @@ -155,8 +171,10 @@ Object {
Object {
"ADR": 58.7,
"KAST": 69.1,
"assists": 3,
"deaths": 46,
"firstKillsDifference": -4,
"flashAssists": 0,
"hsKills": 18,
"id": 483,
"killDeathsDifference": -4,
Expand All @@ -167,8 +185,10 @@ Object {
Object {
"ADR": 49.8,
"KAST": 55.9,
"assists": 18,
"deaths": 51,
"firstKillsDifference": -4,
"flashAssists": 7,
"hsKills": 11,
"id": 484,
"killDeathsDifference": -29,
Expand Down Expand Up @@ -246,8 +266,10 @@ Object {
Object {
"ADR": 66,
"KAST": 65.8,
"assists": 10,
"deaths": 52,
"firstKillsDifference": 8,
"flashAssists": 7,
"hsKills": 28,
"id": 15662,
"killDeathsDifference": -3,
Expand All @@ -258,8 +280,10 @@ Object {
Object {
"ADR": 71.1,
"KAST": 56.2,
"assists": 10,
"deaths": 54,
"firstKillsDifference": 0,
"flashAssists": 2,
"hsKills": 33,
"id": 16948,
"killDeathsDifference": -7,
Expand All @@ -270,8 +294,10 @@ Object {
Object {
"ADR": 62,
"KAST": 67.1,
"assists": 13,
"deaths": 53,
"firstKillsDifference": -8,
"flashAssists": 1,
"hsKills": 28,
"id": 13899,
"killDeathsDifference": -10,
Expand All @@ -282,8 +308,10 @@ Object {
Object {
"ADR": 77.5,
"KAST": 61.6,
"assists": 13,
"deaths": 57,
"firstKillsDifference": 1,
"flashAssists": 1,
"hsKills": 21,
"id": 16946,
"killDeathsDifference": -13,
Expand All @@ -294,8 +322,10 @@ Object {
Object {
"ADR": 60.8,
"KAST": 58.9,
"assists": 13,
"deaths": 61,
"firstKillsDifference": -12,
"flashAssists": 5,
"hsKills": 18,
"id": 9446,
"killDeathsDifference": -26,
Expand All @@ -308,8 +338,10 @@ Object {
Object {
"ADR": 80.8,
"KAST": 76.7,
"assists": 16,
"deaths": 38,
"firstKillsDifference": 4,
"flashAssists": 6,
"hsKills": 17,
"id": 9008,
"killDeathsDifference": 24,
Expand All @@ -320,8 +352,10 @@ Object {
Object {
"ADR": 94.7,
"KAST": 71.2,
"assists": 19,
"deaths": 50,
"firstKillsDifference": 3,
"flashAssists": 5,
"hsKills": 29,
"id": 13779,
"killDeathsDifference": 9,
Expand All @@ -332,8 +366,10 @@ Object {
Object {
"ADR": 91.1,
"KAST": 72.6,
"assists": 8,
"deaths": 43,
"firstKillsDifference": 5,
"flashAssists": 0,
"hsKills": 21,
"id": 14205,
"killDeathsDifference": 16,
Expand All @@ -344,8 +380,10 @@ Object {
Object {
"ADR": 67.9,
"KAST": 75.3,
"assists": 11,
"deaths": 44,
"firstKillsDifference": 0,
"flashAssists": 0,
"hsKills": 29,
"id": 7943,
"killDeathsDifference": 5,
Expand All @@ -356,8 +394,10 @@ Object {
Object {
"ADR": 69.3,
"KAST": 67.1,
"assists": 11,
"deaths": 44,
"firstKillsDifference": -1,
"flashAssists": 3,
"hsKills": 26,
"id": 10590,
"killDeathsDifference": 4,
Expand Down Expand Up @@ -435,8 +475,10 @@ Object {
Object {
"ADR": 91.5,
"KAST": 80,
"assists": 11,
"deaths": 32,
"firstKillsDifference": -5,
"flashAssists": 1,
"hsKills": 20,
"id": 10774,
"killDeathsDifference": 18,
Expand All @@ -447,8 +489,10 @@ Object {
Object {
"ADR": 82.7,
"KAST": 87.3,
"assists": 16,
"deaths": 29,
"firstKillsDifference": 4,
"flashAssists": 7,
"hsKills": 23,
"id": 8600,
"killDeathsDifference": 20,
Expand All @@ -459,8 +503,10 @@ Object {
Object {
"ADR": 96.1,
"KAST": 78.2,
"assists": 10,
"deaths": 41,
"firstKillsDifference": 5,
"flashAssists": 0,
"hsKills": 24,
"id": 8601,
"killDeathsDifference": 8,
Expand All @@ -471,8 +517,10 @@ Object {
Object {
"ADR": 66.8,
"KAST": 72.7,
"assists": 8,
"deaths": 30,
"firstKillsDifference": 2,
"flashAssists": 0,
"hsKills": 12,
"id": 8604,
"killDeathsDifference": -1,
Expand All @@ -483,8 +531,10 @@ Object {
Object {
"ADR": 63.6,
"KAST": 67.3,
"assists": 8,
"deaths": 34,
"firstKillsDifference": -1,
"flashAssists": 3,
"hsKills": 11,
"id": 8950,
"killDeathsDifference": 1,
Expand All @@ -497,8 +547,10 @@ Object {
Object {
"ADR": 100.5,
"KAST": 67.3,
"assists": 14,
"deaths": 43,
"firstKillsDifference": 2,
"flashAssists": 5,
"hsKills": 19,
"id": 11580,
"killDeathsDifference": 6,
Expand All @@ -509,8 +561,10 @@ Object {
Object {
"ADR": 81.7,
"KAST": 61.8,
"assists": 6,
"deaths": 45,
"firstKillsDifference": 4,
"flashAssists": 2,
"hsKills": 23,
"id": 11133,
"killDeathsDifference": -5,
Expand All @@ -521,8 +575,10 @@ Object {
Object {
"ADR": 65.1,
"KAST": 65.5,
"assists": 7,
"deaths": 44,
"firstKillsDifference": -4,
"flashAssists": 1,
"hsKills": 18,
"id": 14140,
"killDeathsDifference": -11,
Expand All @@ -533,8 +589,10 @@ Object {
Object {
"ADR": 55.2,
"KAST": 61.8,
"assists": 4,
"deaths": 38,
"firstKillsDifference": -4,
"flashAssists": 0,
"hsKills": 14,
"id": 14407,
"killDeathsDifference": -11,
Expand All @@ -545,8 +603,10 @@ Object {
Object {
"ADR": 40.9,
"KAST": 61.8,
"assists": 7,
"deaths": 42,
"firstKillsDifference": -3,
"flashAssists": 1,
"hsKills": 7,
"id": 11377,
"killDeathsDifference": -26,
Expand Down
2 changes: 2 additions & 0 deletions src/endpoints/getMatchStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ const getMatchStats = (config: HLTVConfig) => async ({ id }: { id: number }): Pr
name: rowEl.find('.st-player a').text(),
kills: Number(rowEl.find('.st-kills').contents().first().text()),
hsKills: Number(rowEl.find('.st-kills .gtSmartphone-only').text().replace(/\(|\)/g, '')),
assists: Number(rowEl.find('.st-assists').contents().first().text()),
flashAssists: Number(rowEl.find('.st-assists .gtSmartphone-only').text().replace(/\(|\)/g, '')),
deaths: Number(rowEl.find('.st-deaths').text()),
KAST: Number(rowEl.find('.st-kdratio').text().replace('%', '')),
killDeathsDifference: Number(rowEl.find('.st-kddiff').text()),
Expand Down
5 changes: 4 additions & 1 deletion src/models/FullMatchStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export interface PlayerStat extends Player {
readonly value: number
}

export interface PlayerStats extends Player {}
export interface PlayerStats extends Player {
assists: number
flashAssists: number
}

export interface TeamStatComparison {
readonly team1: number,
Expand Down

0 comments on commit 941f731

Please sign in to comment.