(strings: TemplateStringsArray, args: string[])
| 35 | } |
| 36 | |
| 37 | function docCommentTag(strings: TemplateStringsArray, args: string[]) { |
| 38 | const docComment = new DocComment() |
| 39 | const fullText = strings |
| 40 | .flatMap((str, i) => { |
| 41 | if (i < args.length) { |
| 42 | return [str, args[i]] |
| 43 | } |
| 44 | return [str] |
| 45 | }) |
| 46 | .join('') |
| 47 | const lines = trimEmptyLines(fullText.split('\n')) |
| 48 | if (lines.length === 0) { |
| 49 | return docComment |
| 50 | } |
| 51 | const indent = getIndent(lines[0]) |
| 52 | for (const line of lines) { |
| 53 | docComment.addText(line.slice(indent)) |
| 54 | } |
| 55 | return docComment |
| 56 | } |
| 57 | |
| 58 | function trimEmptyLines(lines: string[]): string[] { |
| 59 | const firstLine = findFirstNonEmptyLine(lines) |
no test coverage detected
searching dependent graphs…