faster-auto
Version:
A fast and lightweight framework for building RESTful APIs with Sequelize and Node.js. Supports automatic model loading, flexible query APIs, and built-in Swagger documentation.
16 lines (11 loc) • 321 B
text/typescript
import { ModelStatic } from 'sequelize';
const modelMap: Record<string, ModelStatic<any>> = {};
export function registerModel(name: string, model: ModelStatic<any>) {
modelMap[name] = model;
}
export function getModel(name: string) {
return modelMap[name];
}
export function getAllModels() {
return modelMap;
}