(route: WireEntryRoute)
| 128 | /* ------------------------------------------------------------------ rows -- */ |
| 129 | |
| 130 | export function routeRow(route: WireEntryRoute): EntryRow { |
| 131 | const where = `${basename(route.file)}:${route.line}`; |
| 132 | return { |
| 133 | id: `route:${route.routeId}`, |
| 134 | name: route.path, |
| 135 | method: route.method, |
| 136 | kind: 'route', |
| 137 | // The handler is the answer to "what serves this URL", so it leads the |
| 138 | // meta line; the file only says where to find it. |
| 139 | meta: route.handlerId ? `${route.handler} · ${where}` : `${route.handler} · not in the index`, |
| 140 | target: route.handlerId |
| 141 | ? { type: 'symbol', id: route.handlerId, name: route.handler, kind: route.handlerKind } |
| 142 | : null, |
| 143 | // An inline handler has no name of its own to draw a Flow from. |
| 144 | flowFrom: route.handlerId && !route.inline ? route.handler : null, |
| 145 | title: `${route.url} → ${route.handler} (${route.file}:${route.line}), registered at ${route.routeFile}:${route.routeLine}`, |
| 146 | }; |
| 147 | } |
| 148 | |
| 149 | export function fileRow(file: WireEntryFile): EntryRow { |
| 150 | return { |
no test coverage detected