steamutils 1.2.26 → 1.2.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +4 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2435,7 +2435,8 @@ class SteamUser {
2435
2435
  return await this.getFollowingPlayersList(steamID)
2436
2436
  }
2437
2437
 
2438
- _parsePendingFriendList(selector) {
2438
+ _parsePendingFriendList(html, selector) {
2439
+ const $ = cherrio.load(html || '')
2439
2440
  const data = []
2440
2441
  $(selector).each(function () {
2441
2442
  const el = $(this)
@@ -2463,10 +2464,8 @@ class SteamUser {
2463
2464
  async getPendingFriendList() {
2464
2465
  const result = await this._httpRequest(`${this._myProfile}/friends/pending`)
2465
2466
  if (!result?.data || typeof result._$ !== 'function') return null
2466
- const $ = result._$()
2467
-
2468
- const sentInvites = this._parsePendingFriendList('#search_results_sentinvites > div')
2469
- const receiveInvites = this._parsePendingFriendList('#search_results > div')
2467
+ const sentInvites = this._parsePendingFriendList(result.data, '#search_results_sentinvites > div')
2468
+ const receiveInvites = this._parsePendingFriendList(result.data, '#search_results > div')
2470
2469
  return {
2471
2470
  sentInvites,
2472
2471
  receiveInvites,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.2.26",
3
+ "version": "1.2.27",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.4.0",