Skip to content

Refactor MongoTransform.js#1823

Merged
drew-gross merged 16 commits intoparse-community:masterfrom
drew-gross:tidy-transforms
May 19, 2016
Merged

Refactor MongoTransform.js#1823
drew-gross merged 16 commits intoparse-community:masterfrom
drew-gross:tidy-transforms

Conversation

@drew-gross
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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