(selection: unknown)
| 9 | } |
| 10 | |
| 11 | function selection(selection: unknown) { |
| 12 | if (!selection || typeof selection !== "object") return undefined |
| 13 | const startLine = Number((selection as FileSelection).startLine) |
| 14 | const startChar = Number((selection as FileSelection).startChar) |
| 15 | const endLine = Number((selection as FileSelection).endLine) |
| 16 | const endChar = Number((selection as FileSelection).endChar) |
| 17 | if (![startLine, startChar, endLine, endChar].every(Number.isFinite)) return undefined |
| 18 | return { |
| 19 | startLine, |
| 20 | startChar, |
| 21 | endLine, |
| 22 | endChar, |
| 23 | } satisfies FileSelection |
| 24 | } |
| 25 | |
| 26 | export function createCommentMetadata(input: PromptComment) { |
| 27 | return { |
no outgoing calls
no test coverage detected