Skip to content

Commit cb4d8ce

Browse files
MylesBorinsBethGriggs
authored andcommitted
module: refactor condition
PR-URL: #32989 Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
1 parent 8a4de2e commit cb4d8ce

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
@@ -1121,8 +1121,7 @@ E('ERR_INVALID_PACKAGE_TARGET',
11211121
return `Invalid "exports" main target ${JSONStringify(target)} defined ` +
11221122
`in the package config ${pkgPath}${sep}package.json${relError ?
11231123
'; targets must start with "./"' : ''}`;
1124-
} else if (typeof target === 'string' && target !== '' &&
1125-
!StringPrototypeStartsWith(target, './')) {
1124+
} else if (relError) {
11261125
return `Invalid "exports" target ${JSONStringify(target)} defined for '${
11271126
StringPrototypeSlice(key, 0, -subpath.length || key.length)}' in the ` +
11281127
`package config ${pkgPath}${sep}package.json; ` +

0 commit comments

Comments
 (0)