diff --git a/package.json b/package.json index 548cfab..58abc33 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/src/format.ts b/src/format.ts index 0592934..9ce5c37 100644 --- a/src/format.ts +++ b/src/format.ts @@ -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 }); @@ -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 });