* Extract the `{ ... }` body from a compiled `export interface X { ... }` * declaration so it can be inlined as an anonymous object type. Collapses * newlines onto a single line. Falls back to `unknown` when no brace is found * (e.g. the compiled type is itself `unknown`).
(compiled: string)
| 113 | * (e.g. the compiled type is itself `unknown`). |
| 114 | */ |
| 115 | function inlineBody(compiled: string): string { |
| 116 | const brace = compiled.indexOf('{') |
| 117 | return brace >= 0 |
| 118 | ? compiled.slice(brace).replace(/\n/g, ' ').trim() |
| 119 | : 'unknown' |
| 120 | } |
| 121 | |
| 122 | function emitResources(s: ServerSurface): string { |
| 123 | if (!s.resources.length) return '{}' |
no test coverage detected