MCPcopy
hub / github.com/prisma/prisma / docCommentTag

Function docCommentTag

packages/ts-builders/src/DocComment.ts:37–56  ·  view source on GitHub ↗
(strings: TemplateStringsArray, args: string[])

Source from the content-addressed store, hash-verified

35}
36
37function 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
58function trimEmptyLines(lines: string[]): string[] {
59 const firstLine = findFirstNonEmptyLine(lines)

Callers 1

docCommentFunction · 0.85

Calls 4

addTextMethod · 0.95
trimEmptyLinesFunction · 0.85
getIndentFunction · 0.70
sliceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…