Function
createRgJsonContext
(
filePath: string,
lineNumber: number,
lineText: string,
)
Source from the content-addressed store, hash-verified
| 78 | |
| 79 | /** Helper to create ripgrep JSON context output (for -A, -B, -C flags). */ |
| 80 | export function createRgJsonContext( |
| 81 | filePath: string, |
| 82 | lineNumber: number, |
| 83 | lineText: string, |
| 84 | ): string { |
| 85 | return JSON.stringify({ |
| 86 | type: 'context', |
| 87 | data: { |
| 88 | path: { text: filePath }, |
| 89 | lines: { text: lineText }, |
| 90 | line_number: lineNumber, |
| 91 | }, |
| 92 | }) |
| 93 | } |
Tested by
no test coverage detected