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 Apr 30, 2020
1 parent 7c94f9c commit 06cb700
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
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 06cb700

Please sign in to comment.