steamutils 1.4.3 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/SteamClient.js +7 -7
  2. package/index.js +7350 -7350
  3. package/package.json +1 -1
package/SteamClient.js CHANGED
@@ -297,23 +297,23 @@ function SteamClient({ username, password, cookie, clientJsToken, isAutoRequestF
297
297
  }
298
298
 
299
299
  async function getPersonas(steamIDs) {
300
- steamIDs = steamIDs.map((steamId) => (steamId instanceof SteamID ? steamId.getSteamID64() : steamId));
301
- const notCachesteamIDs = steamIDs.filter((id) => !PersonasCache.some((p) => p.id == id));
302
- const cachedPersonas = PersonasCache.filter((p) => steamIDs.includes(p.id));
300
+ const idsToFetch = steamIDs.map((steamId) => (steamId instanceof SteamID ? steamId.getSteamID64() : steamId));
301
+ const notCachedIDs = idsToFetch.filter((id) => !PersonasCache.some((p) => p.id == id));
302
+ const cachedPersonas = PersonasCache.filter((p) => idsToFetch.includes(p.id));
303
303
 
304
- if (notCachesteamIDs.length) {
304
+ if (notCachedIDs.length) {
305
305
  let personas = null;
306
306
  try {
307
- personas = (await steamClient.getPersonas(notCachesteamIDs))?.personas;
307
+ personas = (await steamClient.getPersonas(notCachedIDs))?.personas;
308
308
  } catch (e) {}
309
309
  if (!personas || !Object.keys(personas).length) {
310
310
  try {
311
- personas = (await steamClient.getPersonas(notCachesteamIDs))?.personas;
311
+ personas = (await steamClient.getPersonas(notCachedIDs))?.personas;
312
312
  } catch (e) {}
313
313
  }
314
314
  if (!personas || !Object.keys(personas).length) {
315
315
  try {
316
- personas = (await steamClient.getPersonas(notCachesteamIDs))?.personas;
316
+ personas = (await steamClient.getPersonas(notCachedIDs))?.personas;
317
317
  } catch (e) {}
318
318
  }
319
319
  if (personas && Object.keys(personas).length) {