1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = extractEventHandlers;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | function extractEventHandlers(object, excludeKeys = []) {
|
15 | if (object === undefined) {
|
16 | return {};
|
17 | }
|
18 | const result = {};
|
19 | Object.keys(object).filter(prop => prop.match(/^on[A-Z]/) && typeof object[prop] === 'function' && !excludeKeys.includes(prop)).forEach(prop => {
|
20 | result[prop] = object[prop];
|
21 | });
|
22 | return result;
|
23 | } |
\ | No newline at end of file |