Skip to content

Commit 6040bfe

Browse files
optimize isfunction uses
1 parent e44b1ff commit 6040bfe

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/oc-client.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ var oc = oc || {};
5151
isBool = function (a) {
5252
return typeof a == 'boolean';
5353
},
54-
isFunction = function (a) {
55-
return typeof a == 'function';
56-
},
5754
timeout = setTimeout,
5855
ocCmd = oc.cmd,
5956
ocConf = oc.conf,
@@ -136,7 +133,7 @@ var oc = oc || {};
136133
var getHeaders = function () {
137134
return $.extend(
138135
{ Accept: 'application/vnd.oc.unrendered+json' },
139-
isFunction(ocConf.globalHeaders)
136+
typeof ocConf.global == 'function'
140137
? ocConf.globalHeaders()
141138
: ocConf.globalHeaders
142139
);
@@ -158,7 +155,7 @@ var oc = oc || {};
158155

159156
// A minimal require.js-ish that uses l.js
160157
oc.require = function (nameSpace, url, callback) {
161-
if (isFunction(url)) {
158+
if (!callback) {
162159
callback = url;
163160
url = nameSpace;
164161
nameSpace = undefined;

0 commit comments

Comments
 (0)