- ✅ 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
66 lines
1.5 KiB
JavaScript
66 lines
1.5 KiB
JavaScript
/**
|
|
* CSS module.
|
|
*/
|
|
export default class UnresolvedModule {
|
|
url;
|
|
#window;
|
|
#hooks = [];
|
|
#error = null;
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @param init Initialization options.
|
|
*/
|
|
constructor(init) {
|
|
this.#window = init.window;
|
|
this.url = init.url;
|
|
}
|
|
/**
|
|
* Compiles and evaluates the module.
|
|
*
|
|
* @returns Module exports.
|
|
*/
|
|
async evaluate() {
|
|
throw new this.#window.TypeError('Unresolved module. We should never end up here.');
|
|
}
|
|
/**
|
|
* Compiles and preloads the module and its imports.
|
|
*
|
|
* @returns Promise.
|
|
*/
|
|
async preload() {
|
|
throw new this.#window.TypeError('Unresolved module. We should never end up here.');
|
|
}
|
|
/**
|
|
* Add a hook to be called when the module is resolved.
|
|
*
|
|
* @param resolve Resolve.
|
|
* @param reject Reject.
|
|
*/
|
|
addResolveListener(resolve, reject) {
|
|
if (this.#error) {
|
|
reject(this.#error);
|
|
return;
|
|
}
|
|
this.#hooks.push({ resolve, reject });
|
|
}
|
|
/**
|
|
* Resolves the module.
|
|
*
|
|
* @param [error] Error.
|
|
*/
|
|
resolve(error) {
|
|
if (error) {
|
|
this.#error = error;
|
|
}
|
|
for (const hook of this.#hooks) {
|
|
if (error) {
|
|
hook.reject(error);
|
|
}
|
|
else {
|
|
hook.resolve(null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//# sourceMappingURL=UnresolvedModule.js.map
|