Skip to content

Commit cab2cf3

Browse files
grimmdudeclaude
andcommitted
fix: add missing return statements in mergeSingleEvent()
The method declared a return type of Track but had two code paths with missing returns: the early return when no events exist returned undefined, and the end of the function had no return at all. Both now return this to match the type contract and enable method chaining. Closes #147 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 691e19a commit cab2cf3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/chunks/track.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class Track implements Chunk {
184184
// There are no events yet, so just add it in.
185185
if (!this.events.length) {
186186
this.addEvent(event);
187-
return;
187+
return this;
188188
}
189189

190190
// Find index of existing event we need to follow with
@@ -220,6 +220,8 @@ class Track implements Chunk {
220220
this.events[i].delta = this.events[i].tick - this.events[i - 1].tick;
221221
}
222222
}
223+
224+
return this;
223225
}
224226

225227
/**

0 commit comments

Comments
 (0)