Skip to content

Commit

Permalink
Merge pull request #2426 from zertosh/remove-isfunction
Browse files Browse the repository at this point in the history
Remove "isFunction" helper in favor of "typeof" check
  • Loading branch information
mikeal committed Oct 17, 2016
2 parents a04f926 + 092e1e6 commit bb8e899
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 2 additions & 3 deletions index.js
Expand Up @@ -18,8 +18,7 @@ var extend = require('extend')
, cookies = require('./lib/cookies')
, helpers = require('./lib/helpers')

var isFunction = helpers.isFunction
, paramsHaveRequestBody = helpers.paramsHaveRequestBody
var paramsHaveRequestBody = helpers.paramsHaveRequestBody


// organize params for patch, post, put, head, del
Expand Down Expand Up @@ -95,7 +94,7 @@ function wrapRequestMethod (method, options, requester, verb) {
target.method = verb.toUpperCase()
}

if (isFunction(requester)) {
if (typeof requester === 'function') {
method = requester
}

Expand Down
5 changes: 0 additions & 5 deletions lib/helpers.js
Expand Up @@ -7,10 +7,6 @@ var defer = typeof setImmediate === 'undefined'
? process.nextTick
: setImmediate

function isFunction(value) {
return typeof value === 'function'
}

function paramsHaveRequestBody(params) {
return (
params.body ||
Expand Down Expand Up @@ -59,7 +55,6 @@ function version () {
}
}

exports.isFunction = isFunction
exports.paramsHaveRequestBody = paramsHaveRequestBody
exports.safeStringify = safeStringify
exports.md5 = md5
Expand Down

0 comments on commit bb8e899

Please sign in to comment.