@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
19 lines • 576 B
JavaScript
export const cloneEvent = (e) => {
if (e === undefined || e === null)
return undefined;
// eslint-disable-next-line @typescript-eslint/no-empty-function
function SyntheticEvent() { }
const clone = new SyntheticEvent();
for (const p in e) {
const d = Object.getOwnPropertyDescriptor(e, p);
if (d && (d.get || d.set)) {
Object.defineProperty(clone, p, d);
}
else {
clone[p] = e[p];
}
}
Object.setPrototypeOf(clone, e);
return clone;
};
//# sourceMappingURL=cloneEvent.js.map