mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-18 15:00:00 +00:00
7 lines
225 B
TypeScript
7 lines
225 B
TypeScript
export function buildEntity<T extends any>(Entity: new () => T, data: Partial<T>): T {
|
|
const instance = new Entity();
|
|
for (const [key, value] of Object.entries(data)) {
|
|
instance[key] = value;
|
|
}
|
|
return instance;
|
|
}
|