chain-simple 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/index.js +2 -4
- package/lib/index.ts +4 -6
- package/package.json +1 -1
package/built/index.js
CHANGED
|
@@ -109,12 +109,10 @@ function makePropertiesChainable(item, config) {
|
|
|
109
109
|
logger_1.logger.chainer(`[CHAIN_SIMPLE]: ${String(p)} is called with args: `, ...arguments);
|
|
110
110
|
if ((0, sat_utils_1.isPromise)(proxifiedResult)) {
|
|
111
111
|
logger_1.logger.chainer(`[CHAIN_SIMPLE]: previous call result is a promise`);
|
|
112
|
-
proxifiedResult = proxifiedResult
|
|
113
|
-
.then(function (r) {
|
|
112
|
+
proxifiedResult = proxifiedResult.then(function (r) {
|
|
114
113
|
logger_1.logger.chainer(`[CHAIN_SIMPLE]: previous call result is: `, r);
|
|
115
114
|
return item[p].call(item, ...arguments_);
|
|
116
|
-
})
|
|
117
|
-
.catch(e => console.log(e));
|
|
115
|
+
});
|
|
118
116
|
}
|
|
119
117
|
else {
|
|
120
118
|
logger_1.logger.chainer(`[CHAIN_SIMPLE]: previous call result is not a promise`);
|
package/lib/index.ts
CHANGED
|
@@ -138,13 +138,11 @@ function makePropertiesChainable(item, config?: TConfig) {
|
|
|
138
138
|
|
|
139
139
|
if (isPromise(proxifiedResult)) {
|
|
140
140
|
logger.chainer(`[CHAIN_SIMPLE]: previous call result is a promise`);
|
|
141
|
-
proxifiedResult = proxifiedResult
|
|
142
|
-
.
|
|
143
|
-
logger.chainer(`[CHAIN_SIMPLE]: previous call result is: `, r);
|
|
141
|
+
proxifiedResult = proxifiedResult.then(function (r) {
|
|
142
|
+
logger.chainer(`[CHAIN_SIMPLE]: previous call result is: `, r);
|
|
144
143
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
.catch(e => console.log(e));
|
|
144
|
+
return item[p].call(item, ...arguments_);
|
|
145
|
+
});
|
|
148
146
|
} else {
|
|
149
147
|
logger.chainer(`[CHAIN_SIMPLE]: previous call result is not a promise`);
|
|
150
148
|
logger.chainer(`[CHAIN_SIMPLE]: previous call result is: `, proxifiedResult);
|