Skip to content

Commit c7e34b7

Browse files
Remove last jQuery external method dep with a custom implementation
1 parent 8aedf00 commit c7e34b7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎src/jquery.cookie.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
function read(s, converter) {
5151
var value = config.raw ? s : parseCookieValue(s);
52-
return $.isFunction(converter) ? converter(value) : value;
52+
return isFunction(converter) ? converter(value) : value;
5353
}
5454

5555
function extend() {
@@ -65,11 +65,15 @@
6565
return result;
6666
}
6767

68+
function isFunction(obj) {
69+
return Object.prototype.toString.call(obj) === '[object Function]';
70+
}
71+
6872
var config = $.cookie = function (key, value, options) {
6973

7074
// Write
7175

72-
if (arguments.length > 1 && !$.isFunction(value)) {
76+
if (arguments.length > 1 && !isFunction(value)) {
7377
options = extend(config.defaults, options);
7478

7579
if (typeof options.expires === 'number') {

0 commit comments

Comments
 (0)