1 | import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2 | function composeProps(originProps, patchProps, isAll) {
|
3 | var composedProps = _objectSpread(_objectSpread({}, originProps), isAll ? patchProps : {});
|
4 | Object.keys(patchProps).forEach(function (key) {
|
5 | var func = patchProps[key];
|
6 | if (typeof func === 'function') {
|
7 | composedProps[key] = function () {
|
8 | var _originProps$key;
|
9 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
10 | args[_key] = arguments[_key];
|
11 | }
|
12 | func.apply(void 0, args);
|
13 | return (_originProps$key = originProps[key]) === null || _originProps$key === void 0 ? void 0 : _originProps$key.call.apply(_originProps$key, [originProps].concat(args));
|
14 | };
|
15 | }
|
16 | });
|
17 | return composedProps;
|
18 | }
|
19 | export default composeProps; |
\ | No newline at end of file |