(url: string, params?: Record<string, string>)
| 401 | * wrapped line is a separate link — inconsistent hover, partial tooltips). |
| 402 | * Empty url = close sequence (empty params per spec). */ |
| 403 | export function link(url: string, params?: Record<string, string>): string { |
| 404 | if (!url) return LINK_END |
| 405 | const p = { id: osc8Id(url), ...params } |
| 406 | const paramStr = Object.entries(p) |
| 407 | .map(([k, v]) => `${k}=${v}`) |
| 408 | .join(':') |
| 409 | return osc(OSC.HYPERLINK, paramStr, url) |
| 410 | } |
| 411 | |
| 412 | function osc8Id(url: string): string { |
| 413 | let h = 0 |
no test coverage detected