Skip to content

Many fixes #14

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 8 commits into from
Jul 20, 2017
Merged

Many fixes #14

merged 8 commits into from
Jul 20, 2017

Conversation

kevmoo
Copy link
Collaborator

@kevmoo kevmoo commented Jul 20, 2017

No description provided.

@kevmoo
Copy link
Collaborator Author

kevmoo commented Jul 20, 2017

Follow-on from #13

@kevmoo kevmoo changed the title WIP: Updates Many fixes Jul 20, 2017
@kevmoo kevmoo requested a review from natebosch July 20, 2017 15:33
// Then we need to add `?.toList()
expression += "?.toList()";
if (!isList) {
// Then we need to add `?.toList()
Copy link
Member

Choose a reason for hiding this comment

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

avoid comments that only repeat what the code is doing - if you want to keep a comment here it should say why we need this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ack

}

return expression;
return "$expression /* unsafe */";
Copy link
Member

Choose a reason for hiding this comment

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

This went from 46 lines to 80 lines - consider breaking out some composed methods

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ack

var subFieldValue =
_fieldToJsonMapValue(substitute, valueType, depth + 1);

// In this case, we're going to create a new Map with matching reified
Copy link
Member

Choose a reason for hiding this comment

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

more comments that only say what is happening...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ack

expression += "?.toList()";
}

return expression;
Copy link
Member

Choose a reason for hiding this comment

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

there are lots of early returns in this method - it's a little hard to keep track

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah – can look at in a future PR. Added a note.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

...or just refactor!

keyArg.isObject ||
_coreStringChecker.isExactlyType(keyArg);

var safeValue = false;
Copy link
Member

Choose a reason for hiding this comment

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

[optional] more declarative is safeValue = valueType.isDynamic || valueType.isObject || _stringBoolNumChecker.isAssignableFromType(valueType);

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice!


// convert

var substitute = "v$depth";
Copy link
Member

Choose a reason for hiding this comment

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

[nit] mixing single and double quotes in this file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kevmoo
Copy link
Collaborator Author

kevmoo commented Jul 20, 2017

@natebosch PTAL

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