Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module: Refine and unify exports resolution error handling #31625

Closed
wants to merge 9 commits into from
Closed
Prev Previous commit
Next Next commit
fixup json stringify
  • Loading branch information
guybedford committed Feb 4, 2020
commit baec562a4372a38d16085dc21bc66098af372621
6 changes: 3 additions & 3 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
const {
ArrayIsArray,
Error,
JSON,
JSONStringify,
Map,
MathAbs,
NumberIsInteger,
Expand Down Expand Up @@ -1091,10 +1091,10 @@ E('ERR_INVALID_PACKAGE_CONFIG',
`Invalid package config %s${sep}package.json, %s`, Error);
E('ERR_INVALID_PACKAGE_TARGET', (pkgPath, key, subpath, target) => {
if (key === '.') {
return `Invalid "exports" main target ${JSON.stringify(target)} defined ` +
return `Invalid "exports" main target ${JSONStringify(target)} defined ` +
`in the package config ${pkgPath}${sep}package.json`;
} else {
return `Invalid "exports" target ${JSON.stringify(target)} defined for '${
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