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.
- package/index.js +6 -13
- 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
|
|
6
|
-
v6: startV6,
|
|
7
|
-
v7: startV7
|
|
8
|
-
};
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
9
5
|
|
|
10
|
-
const load = (
|
|
6
|
+
const load = (options) => {
|
|
11
7
|
const v = getLatestVersion();
|
|
12
|
-
const runner = runners[v];
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
throw new Error(`Unsupported version: ${v}`);
|
|
16
|
-
}
|
|
9
|
+
const mod = require(`./bin/${v}/start.js`);
|
|
17
10
|
|
|
18
|
-
return
|
|
11
|
+
return mod.default(options);
|
|
19
12
|
};
|
|
20
13
|
|
|
21
|
-
export default load;
|
|
14
|
+
export default load;
|