Skip to content

Commit

Permalink
v0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lchzh3473 committed Nov 27, 2023
1 parent aff0224 commit 163d5e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sim-phi/extends",
"version": "0.3.1",
"version": "0.3.2",
"description": "Third-party chart format conversion functions for sim-phi.",
"type": "module",
"main": "dist/index.js",
Expand Down Expand Up @@ -30,7 +30,7 @@
"@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-terser": "^0.4.4",
"@stylistic/eslint-plugin": "^1.4.0",
"@stylistic/eslint-plugin": "^1.4.1",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"eslint": "^8.54.0",
"eslint-plugin-rulesdir": "^0.2.2",
Expand Down
17 changes: 4 additions & 13 deletions src/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,8 @@ export function normalizeSpeedEvents(events: SpeedEventPGS[]): void {
if (events.length) {
const maxEndTime = events.reduce((max, e) => Math.max(max, e.endTime), 0);
if (maxEndTime < 1e9) {
events.push({
startTime: maxEndTime,
endTime: 1e9,
value: events[events.length - 1].value
});
const { value } = events[events.length - 1];
events.push({ startTime: maxEndTime, endTime: 1e9, value });
}
} else {
events.push({ startTime: 0, endTime: 1e9, value: 1 });
Expand All @@ -71,14 +68,8 @@ export function normalizeLineEvents(events: JudgeLineEventPGS[]): void {
if (events.length) {
const maxEndTime = events.reduce((max, e) => Math.max(max, e.endTime), 0);
if (maxEndTime < 1e9) {
events.push({
startTime: maxEndTime,
endTime: 1e9,
start: events[events.length - 1].start,
end: events[events.length - 1].end,
start2: events[events.length - 1].start2,
end2: events[events.length - 1].end2
});
const { end, end2 } = events[events.length - 1];
events.push({ startTime: maxEndTime, endTime: 1e9, start: end, end, start2: end2, end2 });
}
} else {
events.push({ startTime: 0, endTime: 1e9, start: 0, end: 0, start2: 0, end2: 0 });
Expand Down

0 comments on commit 163d5e1

Please sign in to comment.