Parent epic: #146
Context and problem
Pull request 133 introduced a helper to derive the matched segment text from the fragment and its indices when GitHub omits the text field in a text match segment. The current code in src/api.ts still defaults to an empty string in that case, suggesting this fix was lost or never merged on this branch.
Solution
- Reintroduce the segment text derivation helper in src/api.ts and use it in the mapping performed by fetchAllResults().
- Add the corresponding regression test.
Acceptance criteria
- A test in src/api.test.ts simulates a text match segment without a text field and asserts the derived value equals the fragment sliced at the given indices.
- The matched text appears correctly in the JSON output for this case, covered in src/output.test.ts.
Definition of done
Files
- src/api.ts
- src/api.test.ts
Parent epic: #146
Context and problem
Pull request 133 introduced a helper to derive the matched segment text from the fragment and its indices when GitHub omits the text field in a text match segment. The current code in src/api.ts still defaults to an empty string in that case, suggesting this fix was lost or never merged on this branch.
Solution
Acceptance criteria
Definition of done
Files