-
Notifications
You must be signed in to change notification settings - Fork 2.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
added test to readQuery #3838
added test to readQuery #3838
Conversation
@CarloPalinckx: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
It would be better use 'deep-freeze' package to ensure the argument is not changeable. |
I think I don't really agree on this. Not mutating arguments that are passed by reference is a pretty common best practice. With this added test we at least confirm that it doesn't happen. Which should be enough imo. |
}, | ||
}; | ||
|
||
const preQueryCopy = { ...args }; |
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.
Did you mean for this to be a deep copy? The { ...obj }
syntax just copies the top level of the 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.
Yes I did! good spot. I see lodash is already installed so i'll just use cloneDeep
here.
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.
Thanks @CarloPalinckx!
Adds a test to ensure that passed in arguments aren't mutated after a
readQuery
as requested per issue: #2464Fixes #2464.