@tsed/prisma
Version:
Generate Ts.ED JsonSchema based on Prisma models
27 lines • 688 B
JavaScript
export class DmmfEnum {
#imports = new Map();
constructor({ model, modelType }) {
this.model = model;
this.modelType = modelType;
}
get name() {
return this.model.name;
}
get values() {
return this.modelType.values;
}
static getEnums(dmmf, enumsMap) {
const enums = dmmf.schema.enumTypes.model || [];
return enums.map((modelType) => new DmmfEnum({
modelType,
model: enumsMap.get(modelType.name)
}));
}
static symbolName(name) {
return `${name}`;
}
toString() {
return DmmfEnum.symbolName(this.name);
}
}
//# sourceMappingURL=DmmfEnum.js.map