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

refactor: use SafeMap rather than plain object hash for internal results #65

Closed

Conversation

shadowspawn
Copy link
Collaborator

This came out of discussion around potential for prototype pollution. Use a Map rather than Object internally. Convert to Object for returning to client.

See #32 (comment)

Take two, previous draft in #57

ToDo: add some related tests from #57 (review)

Copy link
Collaborator

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, let's just add some tests for prototype pollution and keys named for methods on the prototype.

https://github.com/yargs/yargs-parser/blob/main/test/yargs-parser.cjs#L3712
https://github.com/yargs/yargs-parser/blob/main/test/yargs-parser.cjs#L1011

@shadowspawn
Copy link
Collaborator Author

I am getting pretty used to the primordial routines now, and this got broken by other PR again. Adding some prototype pollution tests is probably still a good idea independent of SafeMap. I won't keep this open as a placeholder for further action though.

@shadowspawn shadowspawn deleted the feature/use-map-internally branch June 5, 2022 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants