(url: string, params?: Record<string, string>)
| 427 | * wrapped line is a separate link — inconsistent hover, partial tooltips). |
| 428 | * Empty url = close sequence (empty params per spec). */ |
| 429 | export function link(url: string, params?: Record<string, string>): string { |
| 430 | if (!url) return LINK_END |
| 431 | const p = { id: osc8Id(url), ...params } |
| 432 | const paramStr = Object.entries(p) |
| 433 | .map(([k, v]) => `${k}=${v}`) |
| 434 | .join(':') |
| 435 | return osc(OSC.HYPERLINK, paramStr, url) |
| 436 | } |
| 437 | |
| 438 | function osc8Id(url: string): string { |
| 439 | let h = 0 |
no test coverage detected