mm_machine 2.8.9 → 2.9.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.
Files changed (2) hide show
  1. package/mod.js +3 -3
  2. package/package.json +1 -1
package/mod.js CHANGED
@@ -612,7 +612,7 @@ Mod.prototype.loadDatas = function () {
612
612
  */
613
613
  Mod.prototype.call = async function (method, ...params) {
614
614
  let method_func = this.getMethod(method);
615
- if (!method_func) return null;
615
+ if (typeof method_func !== 'function') return null;
616
616
 
617
617
  let result;
618
618
 
@@ -639,7 +639,7 @@ Mod.prototype._callBefore = async function (method, params) {
639
639
  let before_method = `${method}Before`;
640
640
  let before_func = this.getMethod(before_method);
641
641
 
642
- if (!before_func) return undefined;
642
+ if (typeof before_func !== 'function') return undefined;
643
643
 
644
644
  try {
645
645
  let result = await before_func.call(this, ...params);
@@ -674,7 +674,7 @@ Mod.prototype._callAfter = async function (method, params, result) {
674
674
  let after_method = `${method}After`;
675
675
  let after_func = this.getMethod(after_method);
676
676
 
677
- if (!after_func) return result;
677
+ if (typeof after_func !== 'function') return result;
678
678
 
679
679
  try {
680
680
  let after = await after_func.call(this, result, ...params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_machine",
3
- "version": "2.8.9",
3
+ "version": "2.9.0",
4
4
  "description": "A flexible Node.js plugin mechanism system for dynamic loading, management and execution of modules. Supports hot reload, lifecycle management, and modern JavaScript features.",
5
5
  "main": "index.js",
6
6
  "scripts": {