mm_expand 2.0.8 → 2.1.0
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/lib/base.js +7 -5
- package/package.json +1 -1
package/lib/base.js
CHANGED
|
@@ -151,7 +151,7 @@ Base.prototype._do = async function (method, ...params) {
|
|
|
151
151
|
try {
|
|
152
152
|
await this._doBeforeProcess(method, ctx);
|
|
153
153
|
if (ctx.cancelled) {
|
|
154
|
-
return ctx
|
|
154
|
+
return ctx;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
await this._doExecuteMethod(method, ctx);
|
|
@@ -333,6 +333,8 @@ Base.prototype._hasEventListeners = function (method) {
|
|
|
333
333
|
return this.listenerCount(method + ':before') > 0 ||
|
|
334
334
|
this.listenerCount(method + ':check') > 0 ||
|
|
335
335
|
this.listenerCount(method + ':render') > 0 ||
|
|
336
|
+
this.listenerCount(method + ':success') > 0 ||
|
|
337
|
+
this.listenerCount(method + ':error') > 0 ||
|
|
336
338
|
this.listenerCount(method + ':after') > 0;
|
|
337
339
|
};
|
|
338
340
|
|
|
@@ -361,11 +363,11 @@ Base.prototype.run = async function (...params) {
|
|
|
361
363
|
* @returns
|
|
362
364
|
*/
|
|
363
365
|
Base.prototype.exec = async function (method, ...params) {
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
throw
|
|
366
|
+
const ret = await this._do(method, ...params);
|
|
367
|
+
if (ret.error) {
|
|
368
|
+
throw ret.error;
|
|
367
369
|
}
|
|
368
|
-
return result;
|
|
370
|
+
return ret.result;
|
|
369
371
|
};
|
|
370
372
|
|
|
371
373
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_expand",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Super Meimei Prototype Function Extension Module - Enhanced operations for string, array, object, date manipulation with error prevention and simplified business logic.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|