slim-ef
Version:
An implementation of basic entity framework functionnalities in typescript
25 lines • 699 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.patchM = exports.With = exports.patch = void 0;
function __patch(entityShema, entity) {
const t = new entityShema();
if (t.constructor !== entity.constructor) {
Object.assign(t, entity);
return t;
}
return entity;
}
function patch(entityShema) {
return (entity) => {
return __patch(entityShema, entity);
};
}
exports.patch = patch;
exports.With = patch;
function patchM(entityShema) {
return (...entities) => {
return entities.map(e => __patch(entityShema, e));
};
}
exports.patchM = patchM;
//# sourceMappingURL=utilis.js.map