Skip to content

Commit 3e4e40d

Browse files
Fix format (#131)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent fb51cb5 commit 3e4e40d

4 files changed

Lines changed: 28 additions & 11 deletions

File tree

dist/post/index.bundle.js

Lines changed: 22 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/post/renderer.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,7 @@ describe("Renderer", () => {
446446
const startTime: number = Date.parse("2024-01-01T00:00:00Z");
447447
const times: Date[] = Array.from(
448448
{ length: MAX_VISIBLE_TIME_LABELS * 2 },
449-
(_, index: number): Date =>
450-
new Date(startTime + index * 1000),
449+
(_, index: number): Date => new Date(startTime + index * 1000),
451450
);
452451
const firstLabel: string = times[0].toLocaleTimeString("en-GB", {
453452
hour12: false,
@@ -489,9 +488,9 @@ describe("Renderer", () => {
489488
expect(labels.length).toBe(times.length);
490489
expect(labels[0]).toBe(firstLabel);
491490
expect(labels[labels.length - 1]).toBe(lastLabel);
492-
expect(labels.filter((label: string): boolean => label.length > 0).length).toBeLessThanOrEqual(
493-
MAX_VISIBLE_TIME_LABELS,
494-
);
491+
expect(
492+
labels.filter((label: string): boolean => label.length > 0).length,
493+
).toBeLessThanOrEqual(MAX_VISIBLE_TIME_LABELS);
495494
expect(labels.some((label: string): boolean => label === "")).toBe(true);
496495
});
497496
});

src/post/renderer.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ const formatTimeLabels = (times: Date[]): string[] => {
2222
}
2323

2424
const usableSlots: number = Math.max(MAX_VISIBLE_TIME_LABELS - 2, 1);
25-
const spacing: number = Math.ceil(
26-
(formattedTimes.length - 2) / usableSlots,
27-
);
25+
const spacing: number = Math.ceil((formattedTimes.length - 2) / usableSlots);
2826

2927
return formattedTimes.map(
3028
(label: string, index: number, array: string[]): string => {

0 commit comments

Comments
 (0)