Skip to content

Commit

Permalink
src: omit bool values of package.json main field
Browse files Browse the repository at this point in the history
PR-URL: #50965
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
  • Loading branch information
anonrig authored and RafaelGSS committed Dec 15, 2023
1 parent 9f54987 commit 9bf1443
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/node_modules.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,8 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON(
return throw_invalid_package_config();
}
} else if (key == "main") {
if (value.get_string(package_config.main)) {
return throw_invalid_package_config();
}
// Omit all non-string values
USE(value.get_string(package_config.main));
} else if (key == "exports") {
if (value.type().get(field_type)) {
return throw_invalid_package_config();
Expand Down

0 comments on commit 9bf1443

Please sign in to comment.