steamutils 1.4.32 → 1.4.33

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="GBrowserProjectService"><![CDATA[{
4
+ "tabs": [
5
+ {
6
+ "url": "http://google.com.vn",
7
+ "createdAt": "2024-08-14T16:14:35Z"
8
+ }
9
+ ]
10
+ }]]></component>
11
+ </project>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.4.32",
3
+ "version": "1.4.33",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.6",
package/utils.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { EAuthTokenPlatformType, LoginApprover, LoginSession } from "steam-session";
2
+ import moment from "moment";
2
3
 
3
4
  const isBrowser = typeof window !== "undefined";
4
5
 
@@ -247,3 +248,20 @@ export function getBonusXpTimeRefresh() {
247
248
  }
248
249
  return resetDay;
249
250
  }
251
+
252
+ export function estimateNextXp(currentXp, xpEarned) {
253
+ //estimate next xp
254
+ let bonusTime = 1;
255
+ if (xpEarned < 4500) {
256
+ bonusTime = 4;
257
+ } else if (xpEarned < 7500) {
258
+ bonusTime = 2;
259
+ } else if (xpEarned < 11200) {
260
+ bonusTime = 1;
261
+ } else {
262
+ bonusTime = 0.175;
263
+ }
264
+
265
+ const nextXp = 30 * 13 * bonusTime;
266
+ return nextXp + currentXp;
267
+ }