@modern-js/bff-core 2.5.1-alpha.1 → 2.5.1-alpha.4

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.
@@ -77,7 +77,7 @@ const generateClient = async ({
77
77
  }
78
78
  const upperHttpMethod = httpMethod.toUpperCase();
79
79
  const routeName = routePath;
80
- handlersCode += `export ${exportStatement} createRequest('${routeName}', '${upperHttpMethod}', '${httpMethodDecider}', ${process.env.PORT || String(port)}${fetcher ? `, fetch` : ""});
80
+ handlersCode += `export ${exportStatement} createRequest('${routeName}', '${upperHttpMethod}', ${process.env.PORT || String(port)}, '${httpMethodDecider}', ${fetcher ? `, fetch` : ""});
81
81
  `;
82
82
  }
83
83
  const importCode = `import { createRequest } from '${requestCreator}';
@@ -177,8 +177,9 @@ class ApiRouter {
177
177
  return null;
178
178
  }
179
179
  } else {
180
- if (!handler)
180
+ if (!handler) {
181
181
  return null;
182
+ }
182
183
  if (typeof handler === "function" && handler.length > 0) {
183
184
  return import_types.HttpMethod.Post;
184
185
  }
@@ -48,7 +48,7 @@ const generateClient = async ({
48
48
  }
49
49
  const upperHttpMethod = httpMethod.toUpperCase();
50
50
  const routeName = routePath;
51
- handlersCode += `export ${exportStatement} createRequest('${routeName}', '${upperHttpMethod}', '${httpMethodDecider}', ${process.env.PORT || String(port)}${fetcher ? `, fetch` : ""});
51
+ handlersCode += `export ${exportStatement} createRequest('${routeName}', '${upperHttpMethod}', ${process.env.PORT || String(port)}, '${httpMethodDecider}', ${fetcher ? `, fetch` : ""});
52
52
  `;
53
53
  }
54
54
  const importCode = `import { createRequest } from '${requestCreator}';
@@ -158,8 +158,9 @@ class ApiRouter {
158
158
  return null;
159
159
  }
160
160
  } else {
161
- if (!handler)
161
+ if (!handler) {
162
162
  return null;
163
+ }
163
164
  if (typeof handler === "function" && handler.length > 0) {
164
165
  return HttpMethod.Post;
165
166
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.5.1-alpha.1",
14
+ "version": "2.5.1-alpha.4",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/cjs/index.js",