Skip to content

Refactor MongoTransform.js #1823

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

Merged
merged 16 commits into from
May 19, 2016

Conversation

drew-gross
Copy link
Contributor

  • Partially breaks dependency of MongoTransform on schemaController
  • Lifts a lots of validation higher in the call tree. Ideally all validation would happen very early in the request.
  • Fixes a lot of bugs involving keys in nested objects with names like "createdAt"
  • Reduce the number of bool parameters in transform functions that do minor tweaks to how the function works.

if (!(operator.objects instanceof Array)) {
throw new Parse.Error(Parse.Error.INVALID_JSON,
'objects to add must be an array');
if (!(objects instanceof Array)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Array.isArray vs instanceof Array

Which is the preferred method these days?

@drew-gross
Copy link
Contributor Author

I'm going to merge this because I have other stuff that builds on it. If anyone has complaints, they can revert or submit a new PR before the next release.

@drew-gross drew-gross merged commit 4d43614 into parse-community:master May 19, 2016
@drew-gross drew-gross deleted the tidy-transforms branch May 19, 2016 01:14
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.

2 participants