Skip to content

Commit

Permalink
Add quotes around URLs in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Oct 22, 2024
1 parent 6216664 commit fd70560
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ exports.packageExports = function * (packageURL, subpath, packageExports, opts =

packageURL = new URL('package.json', packageURL)

throw errors.PACKAGE_PATH_NOT_EXPORTED(`Package subpath '${subpath}' is not defined by "exports" in ${packageURL}`)
throw errors.PACKAGE_PATH_NOT_EXPORTED(`Package subpath '${subpath}' is not defined by "exports" in '${packageURL}'`)
}

exports.packageImports = function * (specifier, parentURL, opts = {}) {
Expand All @@ -305,7 +305,7 @@ exports.packageImports = function * (specifier, parentURL, opts = {}) {
}

if (specifier.startsWith('#')) {
throw errors.PACKAGE_IMPORT_NOT_DEFINED(`Package import specifier '${specifier}' is not defined by "imports" in ${packageURL}`)
throw errors.PACKAGE_IMPORT_NOT_DEFINED(`Package import specifier '${specifier}' is not defined by "imports" in '${packageURL}'`)
}

break
Expand Down Expand Up @@ -360,7 +360,7 @@ exports.validateEngines = function validateEngines (packageURL, packageEngines,
if (!satisfies(version, range)) {
packageURL = new URL('package.json', packageURL)

throw errors.UNSUPPORTED_ENGINE(`Package not compatible with engine '${engine}' ${version}, requires range '${range}' defined by "engines" in ${packageURL}`)
throw errors.UNSUPPORTED_ENGINE(`Package not compatible with engine '${engine}' ${version}, requires range '${range}' defined by "engines" in '${packageURL}'`)
}
}
}
Expand All @@ -387,7 +387,7 @@ exports.packageTarget = function * (packageURL, target, patternMatch, isImports,
if (!target.startsWith('./') && !isImports) {
packageURL = new URL('package.json', packageURL)

throw errors.INVALID_PACKAGE_TARGET(`Invalid target '${target}' defined by "exports" in ${packageURL}`)
throw errors.INVALID_PACKAGE_TARGET(`Invalid target '${target}' defined by "exports" in '${packageURL}'`)
}

if (patternMatch !== null) {
Expand Down

0 comments on commit fd70560

Please sign in to comment.