Skip to content

Conversation

@serp-dev
Copy link
Contributor

No description provided.

_.isObject(options.data) &&
_([
'post', 'patch', 'put'
]).contains((options.type || params.type).toLowerCase())
Copy link
Contributor

@artzhookov artzhookov Mar 23, 2018

Choose a reason for hiding this comment

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

I think it's a good practice to split such huge constructions to smaller pieces to prevent unreadable if conditions.
In this case I'd define a type variable var type = (options.type || params.type).toLowerCase(); above and change this line to

_(['post', 'patch', 'put']).contains(type)

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