-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: expose getPackageScopeConfig
& add findNearestPackageJSON
#54992
Conversation
Review requested:
|
@@ -64,6 +71,7 @@ function deserializePackageJSON(path, contents) { | |||
ObjectDefineProperty(this, 'exports', { __proto__: null, value }); | |||
return this.exports; | |||
}, | |||
...(everything && contents[6]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be explicit? Depending on the package.json this can overwrite existing values in this object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we can't be explicit because we don't know what the keys are—that's the point of this feature ;) also, we don't need to worry about overwriting because this is a rest spread.
4f9cfc4
to
3fdbcd2
Compare
I'm planning to adjust
Side-note: I haven't worked in c++ in ~20 years, so I can't remember if there is potentially a performance implication here. I'm thinking extracting those avoids re-constructed on each loop (but that may be offset by the cost of function call(s)). |
Splitting this into atomic PRs: |
This draft is not ready for review. Opening it in its current state for visibility.