MCPcopy
hub / github.com/blitz-js/blitz / createModelAst

Method createModelAst

packages/generator/src/prisma/model.ts:20–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 }
19
20 private createModelAst(): ast.Model {
21 const properties = [
22 this.getIdField(),
23 this.getCreatedAtField(),
24 this.getUpdatedAtField(),
25 ].filter(Boolean) as ast.Field[]
26
27 const model: ast.Model = {
28 type: "model",
29 name: this.name,
30 properties,
31 }
32
33 for (const field of this.fields) field.appendTo(model)
34
35 return model
36 }
37
38 private getIdField(): ast.Field | undefined {
39 if (this.fieldExists("id")) return

Callers 2

appendToMethod · 0.95
toStringMethod · 0.95

Calls 4

getIdFieldMethod · 0.95
getCreatedAtFieldMethod · 0.95
getUpdatedAtFieldMethod · 0.95
appendToMethod · 0.45

Tested by

no test coverage detected