@waline/vercel 1.31.1 → 1.31.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waline/vercel",
3
- "version": "1.31.1",
3
+ "version": "1.31.2",
4
4
  "description": "vercel server for waline comment system",
5
5
  "keywords": [
6
6
  "waline",
@@ -123,7 +123,7 @@ module.exports = {
123
123
  ? false
124
124
  : LEVELS.split(/\s*,\s*/).map((v) => Number(v)),
125
125
 
126
- audit: !isFalse(COMMENT_AUDIT),
126
+ audit: COMMENT_AUDIT && !isFalse(COMMENT_AUDIT),
127
127
  avatarProxy,
128
128
  oauthUrl,
129
129
  markdown,
@@ -54,12 +54,13 @@ module.exports = class extends think.Controller {
54
54
  plugins.unshift(fn);
55
55
  }
56
56
 
57
- for(let i = 0; i < plugins.length; i++) {
57
+ for (let i = 0; i < plugins.length; i++) {
58
58
  if (!think.isFunction(plugins[i])) {
59
59
  continue;
60
60
  }
61
-
61
+
62
62
  const resp = await plugins[i].call(this, ...args);
63
+
63
64
  if (resp) {
64
65
  return resp;
65
66
  }
@@ -120,16 +120,16 @@ module.exports = {
120
120
  if (!think.isArray(plugins)) {
121
121
  return fns;
122
122
  }
123
-
124
123
 
125
124
  for (let i = 0; i < plugins.length; i++) {
126
125
  const plugin = plugins[i];
127
-
126
+
128
127
  if (!plugin || !plugin[type]) {
129
128
  continue;
130
129
  }
131
130
 
132
131
  const res = callback(plugin[type]);
132
+
133
133
  if (!res) {
134
134
  continue;
135
135
  }
@@ -144,15 +144,19 @@ module.exports = {
144
144
  if (think.isFunction(middleware)) {
145
145
  return middleware;
146
146
  }
147
-
147
+
148
148
  if (think.isArray(middleware)) {
149
- return middleware.filter((m) => think.isFunction(m));
149
+ return middleware.filter((m) => think.isFunction(m));
150
150
  }
151
151
  });
152
-
152
+
153
153
  return middlewares.flat();
154
154
  },
155
155
  getPluginHook(hookName) {
156
- return think.pluginMap('hooks', (hook) => think.isFunction(hook[hookName]) ? hook[hookName] : undefined).filter(v => v);
157
- }
156
+ return think
157
+ .pluginMap('hooks', (hook) =>
158
+ think.isFunction(hook[hookName]) ? hook[hookName] : undefined
159
+ )
160
+ .filter((v) => v);
161
+ },
158
162
  };