From 384b1c0c15d9560476f349943a730ce18b583047 Mon Sep 17 00:00:00 2001 From: Todd Sharp <41924046+recursivecodes@users.noreply.github.com> Date: Tue, 13 Feb 2024 09:13:36 -0500 Subject: [PATCH] Update tsToArray.ts Remove unnecessary `lines.shift()` --- src/tsToArray.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tsToArray.ts b/src/tsToArray.ts index 2556287..2ed1ed3 100644 --- a/src/tsToArray.ts +++ b/src/tsToArray.ts @@ -9,7 +9,8 @@ export default function parseTranscript(vtt: string): ITranscriptLine[] { const lines: string[] = vtt.match(/\[[0-9:.]+\s-->\s[0-9:.]+\].*/g); // 2. remove the first line, which is empty - lines.shift(); + // unnecessary - this line is never empty + // lines.shift(); // 3. convert each line into an object return lines.map(line => { @@ -30,4 +31,4 @@ export default function parseTranscript(vtt: string): ITranscriptLine[] { return { start, end, speech }; }); -} \ No newline at end of file +}