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: tidy code string concat → string templates #55820

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions lib/internal/modules/package_json_reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ function parsePackageName(specifier, base) {
}

function getPackageJSONURL(specifier, base) {
const { packageName, packageSubpath, isScoped } =
parsePackageName(specifier, base);
const { packageName, packageSubpath, isScoped } = parsePackageName(specifier, base);

// ResolveSelf
const packageConfig = getPackageScopeConfig(base);
Expand All @@ -242,8 +241,7 @@ function getPackageJSONURL(specifier, base) {
}
}

let packageJSONUrl =
new URL('./node_modules/' + packageName + '/package.json', base);
let packageJSONUrl = new URL(`./node_modules/${packageName}/package.json`, base);
let packageJSONPath = fileURLToPath(packageJSONUrl);
let lastPath;
do {
Expand All @@ -254,9 +252,10 @@ function getPackageJSONURL(specifier, base) {
// Check for !stat.isDirectory()
if (stat !== 1) {
lastPath = packageJSONPath;
packageJSONUrl = new URL((isScoped ?
'../../../../node_modules/' : '../../../node_modules/') +
packageName + '/package.json', packageJSONUrl);
packageJSONUrl = new URL(
`${isScoped ? '../' : ''}../../../node_modules/${packageName}/package.json`,
packageJSONUrl,
);
packageJSONPath = fileURLToPath(packageJSONUrl);
continue;
}
Expand Down
Loading