Skip to content

Commit f69fae8

Browse files
chore: Simplify condition
Co-authored-by: James Sumners <[email protected]>
1 parent 50a084e commit f69fae8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hook.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ register(${JSON.stringify(realUrl)}, _, set, get, ${JSON.stringify(specifiers.ge
473473
// The reason for this is that Node.js will otherwise crash if the synchronous
474474
// module customization hooks are used: https://github.com/nodejs/node/issues/57327
475475
// The Node.js documentation also mentions that returning nullish values will no longer be supported in future.
476-
if (parentResult.format === 'commonjs' && (parentResult.source === null || parentResult.source === undefined)) {
476+
if (parentResult.format === 'commonjs' && !parentResult.source) {
477477
parentResult.source = readFileSync(fileURLToPath(url), 'utf8')
478478
}
479479

0 commit comments

Comments
 (0)