mm_expand 2.2.5 → 2.2.7

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.
Files changed (2) hide show
  1. package/lib/base.js +1 -32
  2. package/package.json +1 -1
package/lib/base.js CHANGED
@@ -288,22 +288,6 @@ Base.prototype._doCheckPhase = async function (method, ctx) {
288
288
  }
289
289
  };
290
290
 
291
- /**
292
- * 执行方法
293
- * @param {string} method 方法名称
294
- * @param {...object} params 参数列表
295
- * @returns {object} 返回执行结果
296
- */
297
- Base.prototype._exec = async function (method, ...params) {
298
- if (this[method]) {
299
- try {
300
- return await this[method](...params);
301
- } catch (error) {
302
- this.log('error', `[${this.config.name}] ${method}方法执行失败!`, error);
303
- }
304
- }
305
- };
306
-
307
291
  /**
308
292
  * 主方法执行
309
293
  * @param {string} method 方法名称
@@ -320,7 +304,7 @@ Base.prototype._doMainMethod = async function (method, ctx) {
320
304
 
321
305
  if (!ctx.result) {
322
306
  // 调用子类实现的启动逻辑
323
- ctx.result = await this._exec(method, ...ctx.params);
307
+ ctx.result = await this[method](...ctx.params);
324
308
  }
325
309
  }
326
310
  };
@@ -391,7 +375,6 @@ Base.prototype.doEasy = async function (method, ...params) {
391
375
  } catch (error) {
392
376
  // 简单错误处理
393
377
  this.log('error', `快速执行方法${method}出错:`, error);
394
- throw error;
395
378
  }
396
379
  };
397
380
 
@@ -465,20 +448,6 @@ Base.prototype.run = async function (...params) {
465
448
  return await this.do('main', ...params);
466
449
  };
467
450
 
468
- /**
469
- * 执行方法
470
- * @param {string} method 方法名称
471
- * @param {...any} params 参数列表
472
- * @returns
473
- */
474
- Base.prototype.exec = async function (method, ...params) {
475
- const ret = await this._do(method, ...params);
476
- if (ret.error) {
477
- throw ret.error;
478
- }
479
- return ret.result;
480
- };
481
-
482
451
  /**
483
452
  * 执行指令(主要)
484
453
  * @param {string} command 指令
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_expand",
3
- "version": "2.2.5",
3
+ "version": "2.2.7",
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": {