- ✅ Ticket 1.1: Estructura Clean Architecture en backend - ✅ Ticket 1.2: Schemas Zod compartidos - ✅ Ticket 1.3: Refactorización drugs.ts (1362 → 8 archivos modulares) - ✅ Ticket 1.4: Refactorización procedures.ts (3583 → 6 archivos modulares) - ✅ Ticket 1.5: Eliminación de duplicidades (~50 líneas) Cambios principales: - Creada estructura Clean Architecture en backend/src/ - Schemas Zod compartidos en backend/src/shared/schemas/ - Refactorización modular de drugs y procedures - Utilidades genéricas en src/utils/ (filter, validation) - Eliminados scripts obsoletos y documentación antigua - Corregidos errores: QueryClient, import test-error-handling - Build verificado y funcionando correctamente
61 lines
1.2 KiB
JavaScript
61 lines
1.2 KiB
JavaScript
/*!
|
|
* merge-descriptors
|
|
* Copyright(c) 2014 Jonathan Ong
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
* MIT Licensed
|
|
*/
|
|
|
|
'use strict'
|
|
|
|
/**
|
|
* Module exports.
|
|
* @public
|
|
*/
|
|
|
|
module.exports = merge
|
|
|
|
/**
|
|
* Module variables.
|
|
* @private
|
|
*/
|
|
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty
|
|
|
|
/**
|
|
* Merge the property descriptors of `src` into `dest`
|
|
*
|
|
* @param {object} dest Object to add descriptors to
|
|
* @param {object} src Object to clone descriptors from
|
|
* @param {boolean} [redefine=true] Redefine `dest` properties with `src` properties
|
|
* @returns {object} Reference to dest
|
|
* @public
|
|
*/
|
|
|
|
function merge (dest, src, redefine) {
|
|
if (!dest) {
|
|
throw new TypeError('argument dest is required')
|
|
}
|
|
|
|
if (!src) {
|
|
throw new TypeError('argument src is required')
|
|
}
|
|
|
|
if (redefine === undefined) {
|
|
// Default to true
|
|
redefine = true
|
|
}
|
|
|
|
Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName (name) {
|
|
if (!redefine && hasOwnProperty.call(dest, name)) {
|
|
// Skip descriptor
|
|
return
|
|
}
|
|
|
|
// Copy descriptor
|
|
var descriptor = Object.getOwnPropertyDescriptor(src, name)
|
|
Object.defineProperty(dest, name, descriptor)
|
|
})
|
|
|
|
return dest
|
|
}
|