express-fix-any-js 1.8.1 → 1.8.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.
Files changed (2) hide show
  1. package/index.js +6 -13
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,21 +1,14 @@
1
+ import { createRequire } from "module";
1
2
  import getLatestVersion from "./bin/core/getLatestVersion.js";
2
- import startV6 from "./bin/v6/start.js";
3
- import startV7 from "./bin/v7/start.js";
4
3
 
5
- const runners = {
6
- v6: startV6,
7
- v7: startV7
8
- };
4
+ const require = createRequire(import.meta.url);
9
5
 
10
- const load = ({ jsFilePath, inCheckLines, showLog }) => {
6
+ const load = (options) => {
11
7
  const v = getLatestVersion();
12
- const runner = runners[v];
13
8
 
14
- if (!runner) {
15
- throw new Error(`Unsupported version: ${v}`);
16
- }
9
+ const mod = require(`./bin/${v}/start.js`);
17
10
 
18
- return runner({ jsFilePath, inCheckLines, showLog });
11
+ return mod.default(options);
19
12
  };
20
13
 
21
- export default load;
14
+ export default load;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-fix-any-js",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "CLI to build for appjs, the endpoints",
5
5
  "keywords": [
6
6
  "cli",