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 BridgeAR committed Apr 28, 2020
1 parent 79d92b2 commit c97a7ce
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 @@ -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; ` +
Expand Down

0 comments on commit c97a7ce

Please sign in to comment.