1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports.default = void 0;
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | function createChainedFunction(...funcs) {
|
15 | return funcs.filter(f => f != null).reduce((acc, f) => {
|
16 | if (typeof f !== 'function') {
|
17 | throw new Error('Invalid Argument Type, must only provide functions, undefined, or null.');
|
18 | }
|
19 | if (acc === null) return f;
|
20 | return function chainedFunction(...args) {
|
21 |
|
22 | acc.apply(this, args);
|
23 |
|
24 | f.apply(this, args);
|
25 | };
|
26 | }, null);
|
27 | }
|
28 | var _default = createChainedFunction;
|
29 | exports.default = _default;
|
30 | module.exports = exports.default; |
\ | No newline at end of file |