MCPcopy
hub / github.com/prisma/prisma / getModelExport

Method getModelExport

packages/client-generator-ts/src/TSClient/Model.ts:352–369  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

350 }
351
352 private getModelExport(): string {
353 const docLines = this.model.documentation ?? ''
354 const modelLine = `Model ${this.model.name}\n`
355 const docs = `${modelLine}${docLines}`
356
357 const modelTypeExport = ts
358 .moduleExport(
359 ts.typeDeclaration(
360 `${this.model.name}Model`,
361 ts
362 .namedType(`runtime.Types.Result.DefaultSelection`)
363 .addGenericArgument(ts.namedType(getPayloadName(this.model.name))),
364 ),
365 )
366 .setDocComment(ts.docComment(docs))
367
368 return ts.stringify(modelTypeExport)
369 }
370
371 public toTS(): string {
372 const { model } = this

Callers 1

toTSMethod · 0.95

Calls 3

getPayloadNameFunction · 0.90
addGenericArgumentMethod · 0.80
setDocCommentMethod · 0.45

Tested by

no test coverage detected