import-in-the-middle 1.13.1 → 1.13.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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +7 -0
- package/hook.js +5 -0
- package/package.json +2 -2
- package/test/fixtures/something.mts +7 -0
- package/test/hook/v24-typescript.mjs +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.13.2](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.13.1...import-in-the-middle-v1.13.2) (2025-05-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* Don't attempt to wrap TypeScript modules ([#191](https://github.com/nodejs/import-in-the-middle/issues/191)) ([6deb87e](https://github.com/nodejs/import-in-the-middle/commit/6deb87ea069ec2ee749ce2297ea47ce071d18cf9))
|
|
9
|
+
|
|
3
10
|
## [1.13.1](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.13.0...import-in-the-middle-v1.13.1) (2025-02-28)
|
|
4
11
|
|
|
5
12
|
|
package/hook.js
CHANGED
|
@@ -14,6 +14,7 @@ const EXTENSION_RE = /\.(js|mjs|cjs|ts|mts|cts)$/
|
|
|
14
14
|
const NODE_VERSION = process.versions.node.split('.')
|
|
15
15
|
const NODE_MAJOR = Number(NODE_VERSION[0])
|
|
16
16
|
const NODE_MINOR = Number(NODE_VERSION[1])
|
|
17
|
+
const HANDLED_FORMATS = new Set(['builtin', 'module', 'commonjs'])
|
|
17
18
|
|
|
18
19
|
let entrypoint
|
|
19
20
|
|
|
@@ -349,6 +350,10 @@ function createHook (meta) {
|
|
|
349
350
|
return each === specifier || each === result.url || (result.url.startsWith('file:') && each === fileURLToPath(result.url))
|
|
350
351
|
}
|
|
351
352
|
|
|
353
|
+
if (result.format && !HANDLED_FORMATS.has(result.format)) {
|
|
354
|
+
return result
|
|
355
|
+
}
|
|
356
|
+
|
|
352
357
|
if (includeModules && !includeModules.some(match)) {
|
|
353
358
|
return result
|
|
354
359
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "import-in-the-middle",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.2",
|
|
4
4
|
"description": "Intercept imports in Node.js",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"eslint-plugin-promise": "^6.1.1",
|
|
51
51
|
"got": "^14.3.0",
|
|
52
52
|
"imhotap": "^2.1.0",
|
|
53
|
-
"openai": "
|
|
53
|
+
"openai": "4.47.2",
|
|
54
54
|
"ts-node": "^10.9.1",
|
|
55
55
|
"typescript": "^4.7.4",
|
|
56
56
|
"vue": "^3.4.31"
|