Skip to content

Commit 6362670

Browse files
MylesBorinsBridgeAR
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 c489a7e commit 6362670

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
@@ -1117,8 +1117,7 @@ E('ERR_INVALID_PACKAGE_TARGET',
11171117
return `Invalid "exports" main target ${JSONStringify(target)} defined ` +
11181118
`in the package config ${pkgPath}${sep}package.json${relError ?
11191119
'; targets must start with "./"' : ''}`;
1120-
} else if (typeof target === 'string' && target !== '' &&
1121-
!StringPrototypeStartsWith(target, './')) {
1120+
} else if (relError) {
11221121
return `Invalid "exports" target ${JSONStringify(target)} defined for '${
11231122
StringPrototypeSlice(key, 0, -subpath.length || key.length)}' in the ` +
11241123
`package config ${pkgPath}${sep}package.json; ` +

0 commit comments

Comments
 (0)