MCPcopy
hub / github.com/prisma/prisma / DocComment

Class DocComment

packages/ts-builders/src/DocComment.ts:4–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import { Writer } from './Writer'
3
4export class DocComment implements BasicBuilder {
5 readonly lines: string[] = []
6
7 constructor(startingText?: string) {
8 if (startingText) {
9 this.addText(startingText)
10 }
11 }
12
13 addText(text: string): this {
14 this.lines.push(...text.split('\n'))
15 return this
16 }
17
18 write(writer: Writer) {
19 writer.writeLine('/**')
20 for (const line of this.lines) {
21 writer.writeLine(` * ${line}`)
22 }
23 writer.writeLine(' */')
24 return writer
25 }
26}
27
28function docComment(strings: TemplateStringsArray, ...args: string[]): DocComment
29function docComment(startingText?: string): DocComment

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected