Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit c57e8ad

Browse files
fix: handle undefined importAssertions in node16.13 (#8)
* fix: `importAssertions` undefined in node16.13 * test: run with node 16.13.2 Co-authored-by: Hiroki Osame <[email protected]>
1 parent c4156db commit c57e8ad

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/loaders.ts

+3
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ export const load: load = async function (
155155
}
156156

157157
if (url.endsWith('.json')) {
158+
if (!context.importAssertions) {
159+
context.importAssertions = {};
160+
}
158161
context.importAssertions.type = 'json';
159162
}
160163

tests/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const nodeVersions = [
88
process.env.CI
99
? [
1010
'14.19.1',
11-
'16.14.2',
11+
'16.13.2',
1212
'17.8.0',
1313
]
1414
: []

0 commit comments

Comments
 (0)