Skip to content

Commit 9a18aa4

Browse files
authored
Fix deprecated jQuery.isArray
1 parent e34025e commit 9a18aa4

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

bundlewatch.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ const bundlewatchConfig = {
1010
},
1111
{
1212
path: './dist/cloudinary-jquery.min.js',
13-
maxSize: '23kb'
13+
maxSize: '24kb'
1414
},
1515
{
1616
path: './dist/cloudinary-jquery-file-upload.min.js',
17-
maxSize: '24kb'
17+
maxSize: '25kb'
1818
}
1919
],
2020
defaultCompression: 'gzip',

js/jquery.cloudinary.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ var slice = [].slice,
422422
* @returns {boolean} true if item is empty
423423
*/
424424
isEmpty = function(item) {
425-
return (item == null) || (jQuery.isArray(item) || Util.isString(item)) && item.length === 0 || (jQuery.isPlainObject(item) && jQuery.isEmptyObject(item));
425+
return (item == null) || (Array.isArray(item) || Util.isString(item)) && item.length === 0 || (jQuery.isPlainObject(item) && jQuery.isEmptyObject(item));
426426
};
427427

428428
/**
@@ -565,7 +565,7 @@ var slice = [].slice,
565565
setData: setData,
566566
width: width,
567567
isString: isString,
568-
isArray: jQuery.isArray,
568+
isArray: Array.isArray,
569569
isEmpty: isEmpty,
570570

571571
/**
@@ -4728,7 +4728,7 @@ var slice = [].slice,
47284728
return k + '=' + v;
47294729
}).join('|');
47304730
} else if (Util.isArray(value)) {
4731-
if (value.length > 0 && jQuery.isArray(value[0])) {
4731+
if (value.length > 0 && Array.isArray(value[0])) {
47324732
upload_params[key] = jQuery.map(value, function(array_value) {
47334733
return array_value.join(',');
47344734
}).join('|');

src/jquery-file-upload.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ jQuery.fn.unsigned_cloudinary_upload = function(upload_preset, upload_params = {
185185
return k + '=' + v;
186186
}).join('|');
187187
} else if (Util.isArray(value)) {
188-
if (value.length > 0 && jQuery.isArray(value[0])) {
188+
if (value.length > 0 && Array.isArray(value[0])) {
189189
upload_params[key] = jQuery.map(value, function(array_value) {
190190
return array_value.join(',');
191191
}).join('|');

src/util/jquery.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export var identity = function(value) {
238238
/**
239239
* @class Util
240240
*/
241-
export var isArray = jQuery.isArray;
241+
export var isArray = Array.isArray;
242242

243243
export var assign = jQuery.extend;
244244

test/spec/env/js-folder-spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jasmine.getEnv().addReporter(new SpecReporter({
1616
// List of files to test
1717
const files = [
1818
{name: 'canvas-to-blob.min.js', checkSum: "7c7becb6f9ecf2defa663e70a6b3a0f5"},
19-
{name: 'jquery.cloudinary.js', checkSum: "22e7276c8dec1760246a230fd9fa26c3"},
19+
{name: 'jquery.cloudinary.js', checkSum: "171ee44fcb5e68e16362c71775a88afc"},
2020
{name: 'jquery.fileupload.js', checkSum: "4bfd85460689a29e314ddfad50c184e0"},
2121
{name: 'jquery.fileupload-image.js', checkSum: "7c40367b00f74b0c7c43bff009dde942"},
2222
{name: 'jquery.fileupload-process.js', checkSum: "840f65232eaf1619ea0aff1ab4f5e444"},

0 commit comments

Comments
 (0)