(spec: Spec)
| 16 | } |
| 17 | |
| 18 | function normalizeSpec(spec: Spec): TagType { |
| 19 | const ensureType = (currentType: string | undefined) => currentType || 'any' |
| 20 | |
| 21 | const trimDescription = (desc: string) => |
| 22 | desc && desc.endsWith('\n') ? desc.replace(/(\n)+$/, '') : desc |
| 23 | |
| 24 | const string = spec.source[0].source.split(`@${spec.tag}`)[1].trim() |
| 25 | |
| 26 | spec.type = ensureType(spec.type) |
| 27 | spec.description = trimDescription(spec.description) |
| 28 | |
| 29 | return { |
| 30 | ...spec, |
| 31 | string, |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | export default function (docfile: { |
| 36 | filename: string; |
no test coverage detected
searching dependent graphs…