Skip to content

Commit 8e56cf1

Browse files
authored
fix: warning from use of context.importAssertions (#179)
1 parent 8c52014 commit 8e56cf1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

hook.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,8 @@ function createHook (meta) {
367367
}
368368

369369
// Node.js v21 renames importAssertions to importAttributes
370-
if (
371-
(context.importAssertions && context.importAssertions.type === 'json') ||
372-
(context.importAttributes && context.importAttributes.type === 'json')
373-
) {
370+
const importAttributes = context.importAttributes || context.importAssertions
371+
if (importAttributes && importAttributes.type === 'json') {
374372
return result
375373
}
376374

0 commit comments

Comments
 (0)