Function
createRgJsonMatch
(
filePath: string,
lineNumber: number,
lineText: string,
)
Source from the content-addressed store, hash-verified
| 62 | |
| 63 | /** Helper to create ripgrep JSON match output. */ |
| 64 | export function createRgJsonMatch( |
| 65 | filePath: string, |
| 66 | lineNumber: number, |
| 67 | lineText: string, |
| 68 | ): string { |
| 69 | return JSON.stringify({ |
| 70 | type: 'match', |
| 71 | data: { |
| 72 | path: { text: filePath }, |
| 73 | lines: { text: lineText }, |
| 74 | line_number: lineNumber, |
| 75 | }, |
| 76 | }) |
| 77 | } |
| 78 | |
| 79 | /** Helper to create ripgrep JSON context output (for -A, -B, -C flags). */ |
| 80 | export function createRgJsonContext( |
Tested by
no test coverage detected