Skip to content

Commit 38b3afc

Browse files
committed
Add biome formatting fixes
1 parent 92fd8ba commit 38b3afc

2 files changed

Lines changed: 4 additions & 19 deletions

File tree

apps/web/src/lib/subtitles/parse.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ export function parseSubtitleFile({
2323
}
2424
}
2525

26-
function getFileExtension({
27-
fileName,
28-
}: {
29-
fileName: string;
30-
}): string {
26+
function getFileExtension({ fileName }: { fileName: string }): string {
3127
const extension = fileName.split(".").pop();
3228
return extension?.toLowerCase() ?? "";
3329
}

apps/web/src/lib/subtitles/srt.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ const TIMESTAMP_SEPARATOR = /\s*-->\s*/;
55
const TIMESTAMP_PATTERN =
66
/^(\d{2}:\d{2}:\d{2}[,.]\d{1,3})\s*-->\s*(\d{2}:\d{2}:\d{2}[,.]\d{1,3})/;
77

8-
export function parseSrt({
9-
input,
10-
}: {
11-
input: string;
12-
}): ParseSubtitleResult {
8+
export function parseSrt({ input }: { input: string }): ParseSubtitleResult {
139
const normalized = input.replace(/\r\n?/g, "\n").trim();
1410
if (!normalized) {
1511
return {
@@ -79,11 +75,7 @@ export function parseSrt({
7975
};
8076
}
8177

82-
function parseSrtTimestamp({
83-
input,
84-
}: {
85-
input: string;
86-
}): number {
78+
function parseSrtTimestamp({ input }: { input: string }): number {
8779
const normalized = input.trim().replace(",", ".");
8880
const match = normalized.match(/^(\d{2}):(\d{2}):(\d{2})\.(\d{1,3})$/);
8981
if (!match) {
@@ -94,10 +86,7 @@ function parseSrtTimestamp({
9486
const parsedHours = Number.parseInt(hours, 10);
9587
const parsedMinutes = Number.parseInt(minutes, 10);
9688
const parsedSeconds = Number.parseInt(seconds, 10);
97-
const parsedMilliseconds = Number.parseInt(
98-
milliseconds.padEnd(3, "0"),
99-
10,
100-
);
89+
const parsedMilliseconds = Number.parseInt(milliseconds.padEnd(3, "0"), 10);
10190

10291
return (
10392
parsedHours * 3600 +

0 commit comments

Comments
 (0)