-
Notifications
You must be signed in to change notification settings - Fork 63
Closed
Description
Description
mergeSingleEvent() in src/chunks/track.ts declares a return type of Track but has two code paths with missing/incorrect returns:
- Line 175 — early return has no value (
return;instead ofreturn this;) - End of function (~line 210) — no return statement at all
mergeSingleEvent(event: AbstractEvent): Track {
if (!this.events.length) {
this.addEvent(event);
return; // returns undefined, not this
}
// ... rest of function ...
// no return statement
}Impact
Violates the Track return type contract. Any code attempting to chain off mergeSingleEvent() would get undefined.
Suggested Fix
Add return this; to both code paths.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels