mm_statics 1.4.6 → 1.4.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/index.js +9 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -125,7 +125,6 @@ Statics.prototype.main = async function(ctx, next) {
125
125
 
126
126
  /**
127
127
  * 执行静态文件处理
128
- * @method run
129
128
  * @param {Object} ctx http请求上下文
130
129
  * @param {Function} next 跳过当前执行,先执行后面函数
131
130
  * @return {Boolean} 是否执行成功
@@ -148,13 +147,19 @@ Statics.prototype.run = async function(ctx, next) {
148
147
 
149
148
  /**
150
149
  * 用于处理静态文件
151
- * @module statics
150
+ * @param {Object} ctx http请求上下文
151
+ * @param {Function} next 跳过当前执行,先执行后面函数
152
+ * @return {Boolean} 是否执行成功
152
153
  */
153
154
  module.exports = function(root, config, es6_to_amd) {
154
155
  var static = new Statics(root, config, es6_to_amd);
155
156
  if (static.es6_to_amd.files.length > 0) {
156
- return static.main;
157
+ return function(ctx, next) {
158
+ static.main(ctx, next);
159
+ };
157
160
  } else {
158
- return static.run;
161
+ return function(ctx, next) {
162
+ static.run(ctx, next);
163
+ };
159
164
  }
160
165
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_statics",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "description": "这是超级美眉statics函数模块,用于web服务端statics缓存",
5
5
  "main": "index.js",
6
6
  "scripts": {