Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hltv

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hltv - npm Package Compare versions

Comparing version 3.4.1 to 3.4.2

1

lib/config.d.ts
/// <reference types="node" />
/// <reference types="node" />
import { Agent as HttpsAgent } from 'https';

@@ -3,0 +4,0 @@ import { Agent as HttpAgent } from 'http';

2

lib/endpoints/getEvent.js

@@ -74,3 +74,3 @@ "use strict";

}); });
prizeDistribution = $('.placement')
prizeDistribution = $('.placements .placement')
.toArray()

@@ -77,0 +77,0 @@ .map(function (el) {

@@ -45,10 +45,11 @@ "use strict";

return __awaiter(void 0, void 0, void 0, function () {
var pageContent, _b, _c, firstResult;
return __generator(this, function (_d) {
switch (_d.label) {
var pageContent, _b, _c, firstResult, _d;
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
_e.trys.push([0, 2, , 3]);
_c = (_b = JSON).parse;
return [4 /*yield*/, config.loadPage("https://www.hltv.org/search?term=".concat(name))];
case 1:
pageContent = _c.apply(_b, [_d.sent()]);
pageContent = _c.apply(_b, [_e.sent()]);
firstResult = pageContent[0].events[0];

@@ -59,2 +60,6 @@ if (!firstResult) {

return [2 /*return*/, (0, getEvent_1.getEvent)(config)({ id: firstResult.id })];
case 2:
_d = _e.sent();
throw new Error("Event ".concat(name, " not found"));
case 3: return [2 /*return*/];
}

@@ -61,0 +66,0 @@ });

@@ -187,3 +187,3 @@ "use strict";

function getOdds($) {
return $('[class^="world"] tr.provider:not(.hidden)')
return $('tr.provider:not(.hidden)')
.toArray()

@@ -235,3 +235,3 @@ .filter(function (el) { return el.find('.noOdds').length === 0; })

var result;
if (team1TotalRounds && team2TotalRounds) {
if (!isNaN(team1TotalRounds) && !isNaN(team2TotalRounds)) {
var halfsString = mapEl.find('.results-center-half-score').trimText();

@@ -283,8 +283,8 @@ var halfs = halfsString

function getStreams($) {
return $('.stream-box-embed')
return $('.stream-box')
.toArray()
.filter(function (el) { return el.find('.stream-flag').exists(); })
.map(function (streamEl) { return ({
name: streamEl.text(),
link: streamEl.attr('data-stream-embed'),
name: streamEl.find('.stream-box-embed').text(),
link: streamEl.find('.stream-box-embed').attr('data-stream-embed'),
viewers: streamEl.find('.viewers.gtSmartphone-only').numFromText()

@@ -315,11 +315,10 @@ }); })

function getDemos($) {
return $('div[class="stream-box"]:not(:has(.stream-box-embed))')
return $('[class="stream-box"]:not(:has(.stream-box-embed))')
.toArray()
.map(function (demoEl) {
var gotvEl = demoEl.find('.left-right-padding');
if (gotvEl.length !== 0) {
return { name: gotvEl.text(), link: gotvEl.attr('href') };
if (demoEl.attr('data-demo-link')) {
return { name: 'GOTV Demo', link: demoEl.attr('data-demo-link') };
}
return {
name: demoEl.find('.spoiler').text(),
name: demoEl.text(),
link: demoEl.attr('data-stream-embed')

@@ -326,0 +325,0 @@ };

@@ -77,3 +77,3 @@ "use strict";

var changeText = el.find('.change').text();
var isNew = changeText === 'New';
var isNew = changeText === 'NEW TEAM';
var change = changeText === '-' || isNew ? 0 : Number(changeText);

@@ -80,0 +80,0 @@ return { points: points, place: place, team: team, change: change, isNew: isNew };

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var index_1 = require("./index");
var log = function (promise) {

@@ -10,5 +11,5 @@ return promise

// log(HLTV.getMatches())
// log(HLTV.getEvent({ id: 5741 }))
// log(HLTV.getEvent({ id: 6810 }))
// log(HLTV.getEvents())
// log(HLTV.getMatchMapStats({ id: 115827 }))
log(index_1.HLTV.getMatchMapStats({ id: 147749 }));
// log(HLTV.getMatchStats({ id: 79924 }))

@@ -15,0 +16,0 @@ // log(HLTV.getMatchesStats()

{
"name": "hltv",
"version": "3.4.1",
"version": "3.4.2",
"description": "The unofficial HLTV Node.js API",

@@ -44,3 +44,3 @@ "main": "lib/index.js",

"@types/cheerio": "0.22.31",
"@types/jest": "27.5.1",
"@types/jest": "28.1.7",
"@types/random-useragent": "0.3.1",

@@ -51,10 +51,10 @@ "@types/request": "2.48.8",

"@types/uuid": "8.3.4",
"jest": "28.1.0",
"prettier": "2.6.2",
"ts-jest": "28.0.2",
"ts-node": "10.7.0",
"typescript": "4.6.4"
"jest": "28.1.3",
"prettier": "2.7.1",
"ts-jest": "28.0.8",
"ts-node": "10.9.1",
"typescript": "4.7.4"
},
"dependencies": {
"cheerio": "1.0.0-rc.10",
"cheerio": "1.0.0-rc.12",
"request": "2.88.2",

@@ -61,0 +61,0 @@ "socket.io-client": "2.4.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc