lin-cms-test
Version:
The core library of Lin CMS, this package is just for test!
22 lines (21 loc) • 626 B
JavaScript
;
// phone: {
// type: Sequelize.STRING,
// unique: true,
// allowNull: true
// }
Object.defineProperty(exports, "__esModule", { value: true });
function modelExtend(superModel, attributes) {
superModel.tableAttributes = Object.assign({}, superModel.tableAttributes, attributes);
const model = class extends superModel {
};
Object.keys(attributes).forEach(key => {
Object.defineProperty(model.prototype, key, {
get() {
return this.dataValues && this.dataValues[key];
}
});
});
return model;
}
exports.modelExtend = modelExtend;