Skip to content

Commit 195043f

Browse files
MylesBorinstargos
authored andcommitted
module: refactor condition
PR-URL: #32989 Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Andrey Pechkurov <[email protected]>
1 parent d75f644 commit 195043f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/internal/errors.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1113,8 +1113,7 @@ E('ERR_INVALID_PACKAGE_TARGET',
11131113
return `Invalid "exports" main target ${JSONStringify(target)} defined ` +
11141114
`in the package config ${pkgPath}${sep}package.json${relError ?
11151115
'; targets must start with "./"' : ''}`;
1116-
} else if (typeof target === 'string' && target !== '' &&
1117-
!StringPrototypeStartsWith(target, './')) {
1116+
} else if (relError) {
11181117
return `Invalid "exports" target ${JSONStringify(target)} defined for '${
11191118
StringPrototypeSlice(key, 0, -subpath.length || key.length)}' in the ` +
11201119
`package config ${pkgPath}${sep}package.json; ` +

0 commit comments

Comments
 (0)