This repository was archived by the owner on Jun 8, 2019. It is now read-only.
allow object passed to description prop#87
Merged
Conversation
ericf
approved these changes
Dec 28, 2016
Collaborator
ericf
left a comment
There was a problem hiding this comment.
@mattkime this is great, I'm glad it was such a simple change! Thanks for adding the test too. I added a few minor comments about formatting stuff. If you don't have a change to make these changes, let me know and I can just make them.
| ['moduleSourceName', { | ||
| moduleSourceName: 'react-i18n', | ||
| }], | ||
| 'descriptionsAsObjects' |
Collaborator
There was a problem hiding this comment.
Can you move this right after defineMessages so the fixtures remain in alpha order?
|
|
||
| // Always trim the Message Descriptor values. | ||
| return evaluatePath(path).trim(); | ||
| let descriptorValue = evaluatePath(path); |
| return evaluatePath(path).trim(); | ||
| let descriptorValue = evaluatePath(path); | ||
|
|
||
| if( typeof descriptorValue === 'string' ){ |
Collaborator
There was a problem hiding this comment.
Update formatting to match rest of file:
if (condition) {| let descriptorValue = evaluatePath(path); | ||
|
|
||
| if( typeof descriptorValue === 'string' ){ | ||
| descriptorValue = descriptorValue.trim(); |
Collaborator
There was a problem hiding this comment.
This can be an early return:
if (typeof descriptorValue === 'string') {
return descriptorValue.trim();
}
This was referenced Dec 29, 2016
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up to #85 (comment)
Allows objects to be passed to the
descriptionprop.Only code change required was to check the description type before
.trim()Added test to verify this works.