@xcpcio/core 0.53.2 → 0.55.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcpcio/core",
3
- "version": "0.53.2",
3
+ "version": "0.55.0",
4
4
  "description": "XCPCIO Core",
5
5
  "author": "Dup4 <lyuzhi.pan@gmail.com>",
6
6
  "license": "MIT",
@@ -40,36 +40,36 @@
40
40
  "src"
41
41
  ],
42
42
  "dependencies": {
43
- "chroma-js": "^3.1.1",
43
+ "chroma-js": "^3.1.2",
44
44
  "color-diff": "^1.4.0",
45
45
  "dayjs": "^1.11.13",
46
46
  "js-base64": "^3.7.7",
47
47
  "lodash": "^4.17.21",
48
48
  "ordinal": "^1.0.3",
49
- "papaparse": "^5.4.1",
49
+ "papaparse": "^5.5.2",
50
50
  "string-width": "^7.2.0",
51
51
  "xlsx-js-style": "^1.2.0",
52
- "@xcpcio/types": "0.53.2"
52
+ "@xcpcio/types": "0.55.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@babel/types": "^7.25.7",
56
- "@types/chroma-js": "^2.4.4",
55
+ "@babel/types": "^7.27.0",
56
+ "@types/chroma-js": "^3.1.1",
57
57
  "@types/color-diff": "^1.2.5",
58
- "@types/lodash": "^4.17.10",
59
- "@types/node": "^18.19.55",
60
- "@types/papaparse": "^5.3.14",
61
- "@typescript-eslint/eslint-plugin": "^8.8.1",
62
- "@typescript-eslint/parser": "^8.8.1",
63
- "bumpp": "^9.7.1",
64
- "eslint": "^9.12.0",
58
+ "@types/lodash": "^4.17.16",
59
+ "@types/node": "^18.19.84",
60
+ "@types/papaparse": "^5.3.15",
61
+ "@typescript-eslint/eslint-plugin": "^8.28.0",
62
+ "@typescript-eslint/parser": "^8.28.0",
63
+ "bumpp": "^10.1.0",
64
+ "eslint": "^9.23.0",
65
65
  "esmo": "^4.8.0",
66
66
  "npm-run-all": "^4.1.5",
67
- "pnpm": "^9.12.1",
68
- "taze": "^0.17.2",
69
- "typescript": "^5.6.3",
70
- "unbuild": "^2.0.0",
71
- "vite": "^5.4.8",
72
- "vitest": "^2.1.2"
67
+ "pnpm": "^10.7.0",
68
+ "taze": "^19.0.4",
69
+ "typescript": "^5.8.2",
70
+ "unbuild": "^3.5.0",
71
+ "vite": "^5.4.15",
72
+ "vitest": "^3.0.9"
73
73
  },
74
74
  "scripts": {
75
75
  "build": "unbuild",
package/src/rank.ts CHANGED
@@ -1,13 +1,14 @@
1
1
  import type { SubmissionStatus } from "@xcpcio/types";
2
+ import type { Balloons } from "./balloon";
2
3
  import type { SelectOptionItem } from "./basic-types";
3
4
  import type { Contest } from "./contest";
4
5
  import type { Submissions } from "./submission";
6
+
5
7
  import type { Teams } from "./team";
6
8
 
7
9
  import _ from "lodash";
8
-
9
10
  import { Award, MedalType } from "./award";
10
- import { Balloon, type Balloons } from "./balloon";
11
+ import { Balloon } from "./balloon";
11
12
  import { BattleOfGiants } from "./battle-of-giants";
12
13
  import { TeamProblemStatistics } from "./problem";
13
14
  import { RankStatistics } from "./rank-statistics";
@@ -142,10 +143,10 @@ export class Rank {
142
143
  readonly contest: Contest;
143
144
 
144
145
  teams: Teams;
145
- teamsMap: Map<string, Team>;
146
+ teamsMap: Map<string /* teamId */, Team>;
146
147
 
147
148
  submissions: Submissions;
148
- submissionsMap: Map<string, Submission>;
149
+ submissionsMap: Map<string /* submissionId */, Submission>;
149
150
 
150
151
  organizations: Array<string>;
151
152
  originTeams: Teams;
@@ -68,7 +68,7 @@ export class RatingCalculator {
68
68
  u.delta = Math.floor(
69
69
  (this.calcRating(this.users, Math.sqrt(u.rank * u.seed), u)
70
70
  - u.oldRating)
71
- / 2,
71
+ / 2,
72
72
  );
73
73
  sumDelta += u.delta;
74
74
  }
@@ -1,8 +1,9 @@
1
1
  import type { IRatingUser } from "@xcpcio/types";
2
2
 
3
3
  import type { Persons } from "../person";
4
+ import type { RatingHistories } from "./rating-history";
4
5
  import { Person } from "../person";
5
- import { type RatingHistories, RatingHistory } from "./rating-history";
6
+ import { RatingHistory } from "./rating-history";
6
7
 
7
8
  export class RatingUser {
8
9
  id: string;