MCPcopy
hub / github.com/prisma/prisma / write

Method write

packages/ts-builders/src/Import.ts:46–60  ·  view source on GitHub ↗
(writer: Writer)

Source from the content-addressed store, hash-verified

44 }
45
46 write(writer: Writer): void {
47 writer.write('import ')
48 if (this.defaultImport) {
49 writer.write(this.defaultImport)
50 if (this.hasNamedImports()) {
51 writer.write(', ')
52 }
53 }
54
55 if (this.hasNamedImports()) {
56 writer.write('{ ').writeJoined(', ', this.namedImports).write(' }')
57 }
58
59 writer.write(` from "${this.from}"`)
60 }
61
62 private hasNamedImports() {
63 return this.namedImports.length > 0

Callers

nothing calls this directly

Calls 3

hasNamedImportsMethod · 0.95
writeJoinedMethod · 0.80
writeMethod · 0.65

Tested by

no test coverage detected