(fn)
| 25 | * @returns {(event: Event, ...args: unknown[]) => void} |
| 26 | */ |
| 27 | export function self(fn) { |
| 28 | return function (...args) { |
| 29 | var event = /** @type {Event} */ (args[0]); |
| 30 | // @ts-ignore |
| 31 | if (event.target === this) { |
| 32 | // @ts-ignore |
| 33 | fn?.apply(this, args); |
| 34 | } |
| 35 | }; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Substitute for the `stopPropagation` event modifier |