Repository navigation
Conversation
AI-assisted implementation and verification using OpenAI Codex.
Owner
|
appreciate this but this is ai thinking... this is just not a real edge case in the history of .env files. no one uses proto as a key name. not worth the added complexity to support such a non-existent edge case. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both
parse('__proto__=value')and its fast-parser variant silently omit the entry, because assigning the key to a new ordinary object reaches its inherited accessor. The same issue affectspopulate()'s target and returned record, and thereforeconfig({ processEnv: {} }).Store a previously absent
__proto__key as an own writable, enumerable and configurable data property. Keep ordinary assignments and existing own-property updates on their current paths, preserving override behavior and the objects' normal prototypes. Use the helper in both parsers and populate's target/result assignments.Regressions cover both parsers, repeated keys, actual file-based config with custom targets, populate's return value, and first-wins/override behavior. These tests use string environment values.
Validation: the new regressions fail 19 of 29 assertions on unchanged master.
npm testpasses 1224 assertions with one existing skip, including the build, Standard lint and declaration checks.npm run test:perfpasses the required 1.5x threshold: 2.02x for Buffers and 2.03x for strings.git diff --checkpasses. Tested on Node 22.23.1/Linux; Windows and the other CI Node versions were not exercised. Generated distributions are excluded from the change.AI disclosure: OpenAI Codex assisted with investigation, implementation, regression tests, and this description.