steamutils 1.1.32 → 1.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +8 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -523,11 +523,15 @@ function CookieManager(cookie) {
|
|
|
523
523
|
}
|
|
524
524
|
|
|
525
525
|
function setCookie(name, value) {
|
|
526
|
+
removeCookie(name)
|
|
527
|
+
_CookieObj[name] = value
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
function removeCookie(name) {
|
|
526
531
|
const existedKey = Object.keys(_CookieObj).find(k => k.toLowerCase() === name.toLowerCase())
|
|
527
532
|
if (existedKey) {
|
|
528
533
|
delete _CookieObj[existedKey]
|
|
529
534
|
}
|
|
530
|
-
_CookieObj[name] = value
|
|
531
535
|
}
|
|
532
536
|
|
|
533
537
|
function setCookies(cookies) {
|
|
@@ -553,6 +557,7 @@ function CookieManager(cookie) {
|
|
|
553
557
|
|
|
554
558
|
return {
|
|
555
559
|
setCookie,
|
|
560
|
+
removeCookie,
|
|
556
561
|
setCookies,
|
|
557
562
|
getCookie,
|
|
558
563
|
toString,
|
|
@@ -576,6 +581,7 @@ class SteamUser {
|
|
|
576
581
|
|
|
577
582
|
constructor (cookies) {
|
|
578
583
|
this._cookies = new CookieManager(cookies)
|
|
584
|
+
this._cookies.removeCookie('timezoneOffset')
|
|
579
585
|
|
|
580
586
|
let {
|
|
581
587
|
steamMachineAuth,
|
|
@@ -5046,8 +5052,7 @@ class SteamUser {
|
|
|
5046
5052
|
|
|
5047
5053
|
let timestamp = 0
|
|
5048
5054
|
let timestampStr = `${tradehistory_date} ${tradehistory_timestamp}`
|
|
5049
|
-
|
|
5050
|
-
const timestampMoment = moment(`${tradehistory_date} ${tradehistory_timestamp}`, `D MMM, YYYY h:mma`, true).local(true)
|
|
5055
|
+
const timestampMoment = moment(`${tradehistory_date} ${tradehistory_timestamp}`, `D MMM, YYYY h:mma`, true)
|
|
5051
5056
|
if (!timestampMoment.isValid()) {
|
|
5052
5057
|
console.log(`${tradehistory_date} ${tradehistory_timestamp}`);
|
|
5053
5058
|
} else {
|