@xcpcio/core 0.75.2 → 0.76.1
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/dist/index.cjs +27 -8
- package/dist/index.d.cts +10 -4
- package/dist/index.d.mts +10 -4
- package/dist/index.d.ts +10 -4
- package/dist/index.mjs +27 -9
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -200,6 +200,13 @@ function getTimeDiff(seconds) {
|
|
|
200
200
|
return [two(h), two(m), two(s)].join(":");
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
function normalizePath(path) {
|
|
204
|
+
while (path.endsWith("/")) {
|
|
205
|
+
path = path.slice(0, -1);
|
|
206
|
+
}
|
|
207
|
+
return `${path}/`;
|
|
208
|
+
}
|
|
209
|
+
|
|
203
210
|
class ProblemStatistics {
|
|
204
211
|
acceptedNum;
|
|
205
212
|
rejectedNum;
|
|
@@ -687,6 +694,7 @@ class Team {
|
|
|
687
694
|
photo;
|
|
688
695
|
location;
|
|
689
696
|
icpcID;
|
|
697
|
+
ip;
|
|
690
698
|
se;
|
|
691
699
|
constructor() {
|
|
692
700
|
this.id = "";
|
|
@@ -885,6 +893,9 @@ function createTeam(teamJSON) {
|
|
|
885
893
|
if (teamJSON.icpc_id) {
|
|
886
894
|
t.icpcID = teamJSON.icpc_id;
|
|
887
895
|
}
|
|
896
|
+
if (teamJSON.ip) {
|
|
897
|
+
t.ip = teamJSON.ip;
|
|
898
|
+
}
|
|
888
899
|
return t;
|
|
889
900
|
}
|
|
890
901
|
function createTeams(teamsJSON) {
|
|
@@ -1411,12 +1422,14 @@ function createContestIndexList(contestListJSON) {
|
|
|
1411
1422
|
class CodeforcesGymGhostDATConverter {
|
|
1412
1423
|
constructor() {
|
|
1413
1424
|
}
|
|
1414
|
-
convert(rank) {
|
|
1425
|
+
convert(rank, options) {
|
|
1426
|
+
const includeFakeRussianTeams = options?.includeFakeRussianTeams ?? false;
|
|
1427
|
+
const fakeTeamsCount = includeFakeRussianTeams ? 100 : 0;
|
|
1415
1428
|
let res = "";
|
|
1416
1429
|
res += `@contest "${rank.contest.name.getOrDefault()}"
|
|
1417
1430
|
@contlen ${Math.floor(dayjs__default.duration(rank.contest.endTime.diff(rank.contest.startTime)).asMinutes())}
|
|
1418
1431
|
@problems ${rank.contest.problems.length}
|
|
1419
|
-
@teams ${rank.teams.length +
|
|
1432
|
+
@teams ${rank.teams.length + fakeTeamsCount}
|
|
1420
1433
|
@submissions ${rank.submissions.length}
|
|
1421
1434
|
`;
|
|
1422
1435
|
rank.contest.problems.forEach((p) => {
|
|
@@ -1446,10 +1459,12 @@ class CodeforcesGymGhostDATConverter {
|
|
|
1446
1459
|
submissionsIdMap.set(team.id, mp);
|
|
1447
1460
|
}
|
|
1448
1461
|
});
|
|
1449
|
-
|
|
1450
|
-
|
|
1462
|
+
if (includeFakeRussianTeams) {
|
|
1463
|
+
for (let i = 0; i < 100; i++) {
|
|
1464
|
+
res += `@t ${teamIndex},0,1,"\u041F\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043A\u043E\u043C\u0430\u043D\u0434\u0443"
|
|
1451
1465
|
`;
|
|
1452
|
-
|
|
1466
|
+
teamIndex++;
|
|
1467
|
+
}
|
|
1453
1468
|
}
|
|
1454
1469
|
rank.getSubmissions().forEach((submission) => {
|
|
1455
1470
|
const teamId = submission.teamId;
|
|
@@ -1737,15 +1752,18 @@ class ICPCStandingsCsvConverter {
|
|
|
1737
1752
|
}
|
|
1738
1753
|
}
|
|
1739
1754
|
|
|
1740
|
-
function getImageSource(image,
|
|
1755
|
+
function getImageSource(image, data_host) {
|
|
1741
1756
|
if (image?.url) {
|
|
1742
|
-
if (!
|
|
1757
|
+
if (!data_host) {
|
|
1743
1758
|
return image.url;
|
|
1744
1759
|
}
|
|
1745
1760
|
if (image.url.startsWith("http")) {
|
|
1746
1761
|
return image.url;
|
|
1747
1762
|
}
|
|
1748
|
-
|
|
1763
|
+
if (image.url.startsWith("/")) {
|
|
1764
|
+
return image.url;
|
|
1765
|
+
}
|
|
1766
|
+
return `${normalizePath(data_host)}${image.url}`;
|
|
1749
1767
|
}
|
|
1750
1768
|
if (image?.base64) {
|
|
1751
1769
|
return `data:image/${image.type ?? "png"};base64,${image.base64}`;
|
|
@@ -2955,4 +2973,5 @@ exports.isNotCalculatedPenaltyStatus = isNotCalculatedPenaltyStatus;
|
|
|
2955
2973
|
exports.isPending = isPending;
|
|
2956
2974
|
exports.isRejected = isRejected;
|
|
2957
2975
|
exports.isValidMedalType = isValidMedalType;
|
|
2976
|
+
exports.normalizePath = normalizePath;
|
|
2958
2977
|
exports.stringToSubmissionStatus = stringToSubmissionStatus;
|
package/dist/index.d.cts
CHANGED
|
@@ -65,6 +65,8 @@ declare function createDayJS(time?: Date | string | number | undefined): dayjs.D
|
|
|
65
65
|
declare function getTimestamp(time: number | dayjs.Dayjs): number;
|
|
66
66
|
declare function getTimeDiff(seconds: number): string;
|
|
67
67
|
|
|
68
|
+
declare function normalizePath(path: string): string;
|
|
69
|
+
|
|
68
70
|
declare class Contest {
|
|
69
71
|
id: string;
|
|
70
72
|
name: I18nText;
|
|
@@ -252,6 +254,7 @@ declare class Team {
|
|
|
252
254
|
photo?: Image;
|
|
253
255
|
location?: string;
|
|
254
256
|
icpcID?: string;
|
|
257
|
+
ip?: string;
|
|
255
258
|
se: number;
|
|
256
259
|
constructor();
|
|
257
260
|
reset(): void;
|
|
@@ -402,9 +405,12 @@ declare class Rank {
|
|
|
402
405
|
}
|
|
403
406
|
type Ranks = Array<Rank>;
|
|
404
407
|
|
|
408
|
+
interface Options {
|
|
409
|
+
includeFakeRussianTeams?: boolean;
|
|
410
|
+
}
|
|
405
411
|
declare class CodeforcesGymGhostDATConverter {
|
|
406
412
|
constructor();
|
|
407
|
-
convert(rank: Rank): string;
|
|
413
|
+
convert(rank: Rank, options?: Options): string;
|
|
408
414
|
private submissionStatusToCodeforcesGymDatStatus;
|
|
409
415
|
}
|
|
410
416
|
|
|
@@ -422,7 +428,7 @@ declare class ICPCStandingsCsvConverter {
|
|
|
422
428
|
private getMedalCitation;
|
|
423
429
|
}
|
|
424
430
|
|
|
425
|
-
declare function getImageSource(image: Image,
|
|
431
|
+
declare function getImageSource(image: Image, data_host?: string): string;
|
|
426
432
|
|
|
427
433
|
declare class RatingHistory {
|
|
428
434
|
rank: number;
|
|
@@ -553,5 +559,5 @@ declare function isRejected(status: SubmissionStatus): boolean;
|
|
|
553
559
|
declare function isPending(status: SubmissionStatus): boolean;
|
|
554
560
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
555
561
|
|
|
556
|
-
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, stringToSubmissionStatus };
|
|
557
|
-
export type { Awards, Balloons, ContestIndexList, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
|
562
|
+
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
563
|
+
export type { Awards, Balloons, ContestIndexList, Options, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
package/dist/index.d.mts
CHANGED
|
@@ -65,6 +65,8 @@ declare function createDayJS(time?: Date | string | number | undefined): dayjs.D
|
|
|
65
65
|
declare function getTimestamp(time: number | dayjs.Dayjs): number;
|
|
66
66
|
declare function getTimeDiff(seconds: number): string;
|
|
67
67
|
|
|
68
|
+
declare function normalizePath(path: string): string;
|
|
69
|
+
|
|
68
70
|
declare class Contest {
|
|
69
71
|
id: string;
|
|
70
72
|
name: I18nText;
|
|
@@ -252,6 +254,7 @@ declare class Team {
|
|
|
252
254
|
photo?: Image;
|
|
253
255
|
location?: string;
|
|
254
256
|
icpcID?: string;
|
|
257
|
+
ip?: string;
|
|
255
258
|
se: number;
|
|
256
259
|
constructor();
|
|
257
260
|
reset(): void;
|
|
@@ -402,9 +405,12 @@ declare class Rank {
|
|
|
402
405
|
}
|
|
403
406
|
type Ranks = Array<Rank>;
|
|
404
407
|
|
|
408
|
+
interface Options {
|
|
409
|
+
includeFakeRussianTeams?: boolean;
|
|
410
|
+
}
|
|
405
411
|
declare class CodeforcesGymGhostDATConverter {
|
|
406
412
|
constructor();
|
|
407
|
-
convert(rank: Rank): string;
|
|
413
|
+
convert(rank: Rank, options?: Options): string;
|
|
408
414
|
private submissionStatusToCodeforcesGymDatStatus;
|
|
409
415
|
}
|
|
410
416
|
|
|
@@ -422,7 +428,7 @@ declare class ICPCStandingsCsvConverter {
|
|
|
422
428
|
private getMedalCitation;
|
|
423
429
|
}
|
|
424
430
|
|
|
425
|
-
declare function getImageSource(image: Image,
|
|
431
|
+
declare function getImageSource(image: Image, data_host?: string): string;
|
|
426
432
|
|
|
427
433
|
declare class RatingHistory {
|
|
428
434
|
rank: number;
|
|
@@ -553,5 +559,5 @@ declare function isRejected(status: SubmissionStatus): boolean;
|
|
|
553
559
|
declare function isPending(status: SubmissionStatus): boolean;
|
|
554
560
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
555
561
|
|
|
556
|
-
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, stringToSubmissionStatus };
|
|
557
|
-
export type { Awards, Balloons, ContestIndexList, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
|
562
|
+
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
563
|
+
export type { Awards, Balloons, ContestIndexList, Options, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
package/dist/index.d.ts
CHANGED
|
@@ -65,6 +65,8 @@ declare function createDayJS(time?: Date | string | number | undefined): dayjs.D
|
|
|
65
65
|
declare function getTimestamp(time: number | dayjs.Dayjs): number;
|
|
66
66
|
declare function getTimeDiff(seconds: number): string;
|
|
67
67
|
|
|
68
|
+
declare function normalizePath(path: string): string;
|
|
69
|
+
|
|
68
70
|
declare class Contest {
|
|
69
71
|
id: string;
|
|
70
72
|
name: I18nText;
|
|
@@ -252,6 +254,7 @@ declare class Team {
|
|
|
252
254
|
photo?: Image;
|
|
253
255
|
location?: string;
|
|
254
256
|
icpcID?: string;
|
|
257
|
+
ip?: string;
|
|
255
258
|
se: number;
|
|
256
259
|
constructor();
|
|
257
260
|
reset(): void;
|
|
@@ -402,9 +405,12 @@ declare class Rank {
|
|
|
402
405
|
}
|
|
403
406
|
type Ranks = Array<Rank>;
|
|
404
407
|
|
|
408
|
+
interface Options {
|
|
409
|
+
includeFakeRussianTeams?: boolean;
|
|
410
|
+
}
|
|
405
411
|
declare class CodeforcesGymGhostDATConverter {
|
|
406
412
|
constructor();
|
|
407
|
-
convert(rank: Rank): string;
|
|
413
|
+
convert(rank: Rank, options?: Options): string;
|
|
408
414
|
private submissionStatusToCodeforcesGymDatStatus;
|
|
409
415
|
}
|
|
410
416
|
|
|
@@ -422,7 +428,7 @@ declare class ICPCStandingsCsvConverter {
|
|
|
422
428
|
private getMedalCitation;
|
|
423
429
|
}
|
|
424
430
|
|
|
425
|
-
declare function getImageSource(image: Image,
|
|
431
|
+
declare function getImageSource(image: Image, data_host?: string): string;
|
|
426
432
|
|
|
427
433
|
declare class RatingHistory {
|
|
428
434
|
rank: number;
|
|
@@ -553,5 +559,5 @@ declare function isRejected(status: SubmissionStatus): boolean;
|
|
|
553
559
|
declare function isPending(status: SubmissionStatus): boolean;
|
|
554
560
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
555
561
|
|
|
556
|
-
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, stringToSubmissionStatus };
|
|
557
|
-
export type { Awards, Balloons, ContestIndexList, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
|
562
|
+
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
563
|
+
export type { Awards, Balloons, ContestIndexList, Options, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
package/dist/index.mjs
CHANGED
|
@@ -169,6 +169,13 @@ function getTimeDiff(seconds) {
|
|
|
169
169
|
return [two(h), two(m), two(s)].join(":");
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
+
function normalizePath(path) {
|
|
173
|
+
while (path.endsWith("/")) {
|
|
174
|
+
path = path.slice(0, -1);
|
|
175
|
+
}
|
|
176
|
+
return `${path}/`;
|
|
177
|
+
}
|
|
178
|
+
|
|
172
179
|
class ProblemStatistics {
|
|
173
180
|
acceptedNum;
|
|
174
181
|
rejectedNum;
|
|
@@ -656,6 +663,7 @@ class Team {
|
|
|
656
663
|
photo;
|
|
657
664
|
location;
|
|
658
665
|
icpcID;
|
|
666
|
+
ip;
|
|
659
667
|
se;
|
|
660
668
|
constructor() {
|
|
661
669
|
this.id = "";
|
|
@@ -854,6 +862,9 @@ function createTeam(teamJSON) {
|
|
|
854
862
|
if (teamJSON.icpc_id) {
|
|
855
863
|
t.icpcID = teamJSON.icpc_id;
|
|
856
864
|
}
|
|
865
|
+
if (teamJSON.ip) {
|
|
866
|
+
t.ip = teamJSON.ip;
|
|
867
|
+
}
|
|
857
868
|
return t;
|
|
858
869
|
}
|
|
859
870
|
function createTeams(teamsJSON) {
|
|
@@ -1380,12 +1391,14 @@ function createContestIndexList(contestListJSON) {
|
|
|
1380
1391
|
class CodeforcesGymGhostDATConverter {
|
|
1381
1392
|
constructor() {
|
|
1382
1393
|
}
|
|
1383
|
-
convert(rank) {
|
|
1394
|
+
convert(rank, options) {
|
|
1395
|
+
const includeFakeRussianTeams = options?.includeFakeRussianTeams ?? false;
|
|
1396
|
+
const fakeTeamsCount = includeFakeRussianTeams ? 100 : 0;
|
|
1384
1397
|
let res = "";
|
|
1385
1398
|
res += `@contest "${rank.contest.name.getOrDefault()}"
|
|
1386
1399
|
@contlen ${Math.floor(dayjs.duration(rank.contest.endTime.diff(rank.contest.startTime)).asMinutes())}
|
|
1387
1400
|
@problems ${rank.contest.problems.length}
|
|
1388
|
-
@teams ${rank.teams.length +
|
|
1401
|
+
@teams ${rank.teams.length + fakeTeamsCount}
|
|
1389
1402
|
@submissions ${rank.submissions.length}
|
|
1390
1403
|
`;
|
|
1391
1404
|
rank.contest.problems.forEach((p) => {
|
|
@@ -1415,10 +1428,12 @@ class CodeforcesGymGhostDATConverter {
|
|
|
1415
1428
|
submissionsIdMap.set(team.id, mp);
|
|
1416
1429
|
}
|
|
1417
1430
|
});
|
|
1418
|
-
|
|
1419
|
-
|
|
1431
|
+
if (includeFakeRussianTeams) {
|
|
1432
|
+
for (let i = 0; i < 100; i++) {
|
|
1433
|
+
res += `@t ${teamIndex},0,1,"\u041F\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043A\u043E\u043C\u0430\u043D\u0434\u0443"
|
|
1420
1434
|
`;
|
|
1421
|
-
|
|
1435
|
+
teamIndex++;
|
|
1436
|
+
}
|
|
1422
1437
|
}
|
|
1423
1438
|
rank.getSubmissions().forEach((submission) => {
|
|
1424
1439
|
const teamId = submission.teamId;
|
|
@@ -1706,15 +1721,18 @@ class ICPCStandingsCsvConverter {
|
|
|
1706
1721
|
}
|
|
1707
1722
|
}
|
|
1708
1723
|
|
|
1709
|
-
function getImageSource(image,
|
|
1724
|
+
function getImageSource(image, data_host) {
|
|
1710
1725
|
if (image?.url) {
|
|
1711
|
-
if (!
|
|
1726
|
+
if (!data_host) {
|
|
1712
1727
|
return image.url;
|
|
1713
1728
|
}
|
|
1714
1729
|
if (image.url.startsWith("http")) {
|
|
1715
1730
|
return image.url;
|
|
1716
1731
|
}
|
|
1717
|
-
|
|
1732
|
+
if (image.url.startsWith("/")) {
|
|
1733
|
+
return image.url;
|
|
1734
|
+
}
|
|
1735
|
+
return `${normalizePath(data_host)}${image.url}`;
|
|
1718
1736
|
}
|
|
1719
1737
|
if (image?.base64) {
|
|
1720
1738
|
return `data:image/${image.type ?? "png"};base64,${image.base64}`;
|
|
@@ -2864,4 +2882,4 @@ class ResolverVue extends Resolver {
|
|
|
2864
2882
|
}
|
|
2865
2883
|
}
|
|
2866
2884
|
|
|
2867
|
-
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, stringToSubmissionStatus };
|
|
2885
|
+
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcpcio/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.76.1",
|
|
5
5
|
"description": "The core library for XCPCIO",
|
|
6
6
|
"author": "Dup4 <hi@dup4.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"chroma-js": "^3.
|
|
36
|
+
"chroma-js": "^3.2.0",
|
|
37
37
|
"color-diff": "^1.4.0",
|
|
38
38
|
"dayjs": "^1.11.19",
|
|
39
39
|
"js-base64": "^3.7.8",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"papaparse": "^5.5.3",
|
|
43
43
|
"string-width": "^8.1.0",
|
|
44
44
|
"xlsx-js-style": "^1.2.0",
|
|
45
|
-
"@xcpcio/types": "0.
|
|
45
|
+
"@xcpcio/types": "0.76.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@babel/types": "^7.28.5",
|
|
@@ -53,16 +53,16 @@
|
|
|
53
53
|
"@types/papaparse": "^5.5.0",
|
|
54
54
|
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
|
55
55
|
"@typescript-eslint/parser": "^8.48.0",
|
|
56
|
-
"bumpp": "^10.3.
|
|
56
|
+
"bumpp": "^10.3.2",
|
|
57
57
|
"eslint": "^9.39.1",
|
|
58
58
|
"esmo": "^4.8.0",
|
|
59
59
|
"npm-run-all": "^4.1.5",
|
|
60
|
-
"pnpm": "^10.
|
|
61
|
-
"taze": "^19.9.
|
|
60
|
+
"pnpm": "^10.24.0",
|
|
61
|
+
"taze": "^19.9.2",
|
|
62
62
|
"typescript": "^5.9.3",
|
|
63
63
|
"unbuild": "^3.6.1",
|
|
64
64
|
"vite": "^7.2.4",
|
|
65
|
-
"vitest": "^
|
|
65
|
+
"vitest": "^4.0.14"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "unbuild",
|