1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.passOrGet = passOrGet;
|
7 | exports.callOrNothingAtAll = callOrNothingAtAll;
|
8 |
|
9 | function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
10 |
|
11 | function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
12 |
|
13 | function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
14 |
|
15 | function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | function passOrGet(value) {
|
26 | var argumentList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
27 |
|
28 | if (typeof value === 'function') {
|
29 | return value.apply(void 0, _toConsumableArray(argumentList));
|
30 | }
|
31 |
|
32 | return value;
|
33 | }
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | function callOrNothingAtAll(callback) {
|
47 | var argumentList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
48 |
|
49 | if (typeof callback === 'function') {
|
50 | return callback.apply(void 0, _toConsumableArray(passOrGet(argumentList)));
|
51 | }
|
52 | } |
\ | No newline at end of file |