1 | {"version":3,"file":"extendComponent.js","sourceRoot":"../src/","sources":["extendComponent.ts"],"names":[],"mappings":";;AACA,mDAAkD;AAElD;;GAEG;AACH,SAAgB,eAAe,CAA4B,MAAS,EAAE,OAAsC;IAC1G,KAAK,IAAI,MAAI,IAAI,OAAO,EAAE;QACxB,IAAI,OAAO,CAAC,cAAc,CAAC,MAAI,CAAC,EAAE;YAChC,8DAA8D;YAC9D,MAAM,CAAC,MAAI,CAAC,GAAG,+BAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAI,CAAC,EAAE,OAAO,CAAC,MAAI,CAAC,CAAQ,CAAC;SAC3E;KACF;AACH,CAAC;AAPD,0CAOC","sourcesContent":["import * as React from 'react';\nimport { appendFunction } from './appendFunction';\n\n/**\n * Extends a component's lifetime methods by appending new functions to the existing lifetime functions.\n */\nexport function extendComponent<T extends React.Component>(parent: T, methods: { [key in keyof T]?: T[key] }): void {\n for (let name in methods) {\n if (methods.hasOwnProperty(name)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parent[name] = appendFunction(parent, parent[name], methods[name]) as any;\n }\n }\n}\n"]} |