MCPcopy
hub / github.com/sequelize/sequelize-auto / createInitString

Method createInitString

src/auto-writer.ts:73–84  ·  view source on GitHub ↗
(tableNames: string[], assoc: string, lang?: string)

Source from the content-addressed store, hash-verified

71 return Promise.all(promises);
72 }
73 private createInitString(tableNames: string[], assoc: string, lang?: string) {
74 switch (lang) {
75 case 'ts':
76 return this.createTsInitString(tableNames, assoc);
77 case 'esm':
78 return this.createESMInitString(tableNames, assoc);
79 case 'es6':
80 return this.createES5InitString(tableNames, assoc, "const");
81 default:
82 return this.createES5InitString(tableNames, assoc, "var");
83 }
84 }
85 private createFile(table: string) {
86 // FIXME: schema is not used to write the file name and there could be collisions. For now it
87 // is up to the developer to pick the right schema, and potentially chose different output

Callers 1

writeMethod · 0.95

Calls 3

createTsInitStringMethod · 0.95
createESMInitStringMethod · 0.95
createES5InitStringMethod · 0.95

Tested by

no test coverage detected