mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
module: refactor condition
PR-URL: https://github.com/nodejs/node/pull/32989 Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
This commit is contained in:
committed by
Ruben Bridgewater
parent
79d92b2931
commit
c97a7ce39c
@@ -1117,8 +1117,7 @@ E('ERR_INVALID_PACKAGE_TARGET',
|
||||
return `Invalid "exports" main target ${JSONStringify(target)} defined ` +
|
||||
`in the package config ${pkgPath}${sep}package.json${relError ?
|
||||
'; targets must start with "./"' : ''}`;
|
||||
} else if (typeof target === 'string' && target !== '' &&
|
||||
!StringPrototypeStartsWith(target, './')) {
|
||||
} else if (relError) {
|
||||
return `Invalid "exports" target ${JSONStringify(target)} defined for '${
|
||||
StringPrototypeSlice(key, 0, -subpath.length || key.length)}' in the ` +
|
||||
`package config ${pkgPath}${sep}package.json; ` +
|
||||
|
||||
Reference in New Issue
Block a user