mirror of
https://github.com/sergeyyarkov/asu_tools_service.git
synced 2026-10-11 02:19:09 +03:00
14 lines
290 B
JavaScript
14 lines
290 B
JavaScript
/** @import sql from "mssql" */
|
|
|
|
export class BaseModel {
|
|
/**
|
|
* @template T
|
|
* @this {new (args: any) => T} Model
|
|
* @param {sql.IRecordSet<any>} recordset
|
|
* @returns {T[]}
|
|
*/
|
|
static fromRecordset(recordset) {
|
|
return recordset.map((row) => new this({ ...row }));
|
|
}
|
|
}
|