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

Remove "isFunction" helper in favor of "typeof" check #2426

Merged
merged 1 commit into from Oct 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -11,10 +11,6 @@ function deferMethod() {
return setImmediate
}

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

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

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