Skip to content

Commit cb4d8ce

Browse files
MylesBorinsBethGriggs
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 8a4de2e commit cb4d8ce

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎lib/internal/errors.js‎

Lines changed: 1 addition & 2 deletions
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-
}elseif(typeoftarget==='string'&&target!==''&&
1125-
!StringPrototypeStartsWith(target,'./')){
1124+
}elseif(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)