Skip to content
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

Add defaultValue for method parameters #57

Merged
merged 1 commit into from
Nov 7, 2014
Merged

Add defaultValue for method parameters #57

merged 1 commit into from
Nov 7, 2014

Conversation

tarmolov
Copy link
Member

@tarmolov tarmolov commented Nov 6, 2014

No description provided.

@tarmolov
Copy link
Member Author

tarmolov commented Nov 6, 2014

waits #56

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 286c8f1 on default into da0abce on master.

| name | String | Parameter name |
| description | String | Parameter description |
| \[type\] | String | Parameter type (String, Number, Boolean, etc.) |
| \[defaultValue\] | Any | Default value of the parameter |

Choose a reason for hiding this comment

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

Have you considered default instead of defaultValue?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope.

Do you think default is clear? Is it default for type? for name?
Maybe these questions are only in my head :)

Choose a reason for hiding this comment

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

In time the Value-part of this property will seem redundant :)
Also joi names it default, though it's a method.

Let's ask @dodev :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that default can only be associated with value for a parameter, since it has it's name already declared. The only possible mistake that comes to mind is defaultType, but the existence of such a 'thing' seems unlikely and that's what JSDoc is for.
For me it's not a big deal, but since you're asking my opinion, I vote for default, because it's shorter + the above.

Choose a reason for hiding this comment

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

Browser support for reserved words as properties

Public interface is always painful to change, so I thought it's better to bring this question up before feature release. )

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm OK with defaultValue, too, if default would be a problem because is reserved

@tarmolov
Copy link
Member Author

tarmolov commented Nov 7, 2014

Decided to keep defaultValue.

tarmolov added a commit that referenced this pull request Nov 7, 2014
Add defaultValue for method parameters
@tarmolov tarmolov merged commit b7faa4f into master Nov 7, 2014
@tarmolov tarmolov deleted the default branch November 7, 2014 14:29
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.

4 participants