Skip to content

Commit

Permalink
module: refactor condition
Browse files Browse the repository at this point in the history
PR-URL: #32989
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
  • Loading branch information
MylesBorins authored and targos committed May 13, 2020
1 parent d75f644 commit 195043f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/internal/errors.js
Expand Up @@ -1113,8 +1113,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; ` +
Expand Down

0 comments on commit 195043f

Please sign in to comment.