22 lines
954 B
JavaScript
22 lines
954 B
JavaScript
const fs = require('fs');
|
|
let code = fs.readFileSync('src/sections/HistoriaClinica.tsx', 'utf8');
|
|
|
|
const regex = /function SeccionLaboratorios\(\{ lab, patientId, internacionId, add, update, del, addAcidoBase, canEdit, portalNode\}: \{([\s\S]*?)\}\) \{/;
|
|
|
|
const repl = `function SeccionLaboratorios({ lab, otrosLaboratorios = [], patientId, internacionId, add, update, del, addAcidoBase, addOtroLaboratorio, canEdit, portalNode}: {
|
|
lab: Laboratorio[];
|
|
otrosLaboratorios?: OtroLaboratorio[];
|
|
patientId: string;
|
|
internacionId: string;
|
|
add: (l: Omit<Laboratorio, 'id'>) => void;
|
|
update: (id: string, data: Partial<Laboratorio>) => void;
|
|
del: (id: string) => void;
|
|
addAcidoBase?: (a: Omit<AcidoBase, 'id'>) => void;
|
|
addOtroLaboratorio?: (o: Omit<OtroLaboratorio, 'id'>) => void;
|
|
canEdit?: boolean;
|
|
portalNode?: HTMLDivElement | null;
|
|
}) {`;
|
|
|
|
code = code.replace(regex, repl);
|
|
fs.writeFileSync('src/sections/HistoriaClinica.tsx', code);
|