MCPcopy
hub / github.com/prisma/prisma / getMethodJSDocBody

Function getMethodJSDocBody

packages/client-generator-js/src/TSClient/helpers.ts:8–21  ·  view source on GitHub ↗
(action: DMMF.ModelAction, mapping: DMMF.ModelMapping, model: DMMF.Model)

Source from the content-addressed store, hash-verified

6import { JSDocs } from './jsdoc'
7
8export function getMethodJSDocBody(action: DMMF.ModelAction, mapping: DMMF.ModelMapping, model: DMMF.Model): string {
9 const ctx: JSDocMethodBodyCtx = {
10 singular: capitalize(mapping.model),
11 plural: capitalize(mapping.plural),
12 firstScalar: model.fields.find((f) => f.kind === 'scalar'),
13 method: `prisma.${uncapitalize(mapping.model)}.${action}`,
14 action,
15 mapping,
16 model,
17 }
18 const jsdoc = JSDocs[action]?.body(ctx)
19
20 return jsdoc ? jsdoc : ''
21}
22
23export function getMethodJSDoc(action: DMMF.ModelAction, mapping: DMMF.ModelMapping, model: DMMF.Model): string {
24 return wrapComment(getMethodJSDocBody(action, mapping, model))

Callers 2

buildModelDelegateMethodFunction · 0.90
getMethodJSDocFunction · 0.70

Calls 2

capitalizeFunction · 0.90
uncapitalizeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…