Skip to content

Commit 5b3da47

Browse files
committed
migrate dprecated $.isArray to Array.isArray
`$.isArray` is deprecated in jQuery 3.2, so Array.isArray should be the way to go. jquery/jquery#2961 https://blog.jquery.com/2017/03/16/jquery-3-2-0-is-out/
1 parent 59a1293 commit 5b3da47

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/jquery.autocomplete.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
if (!currentValue) {
139139
return suggestion.value;
140140
}
141-
141+
142142
var pattern = '(' + utils.escapeRegExChars(currentValue) + ')';
143143

144144
return suggestion.value
@@ -237,7 +237,7 @@
237237
that.hide();
238238
}, 200);
239239
},
240-
240+
241241
abortAjax: function () {
242242
var that = this;
243243
if (that.currentRequest) {
@@ -252,7 +252,7 @@
252252

253253
this.options = $.extend({}, options, suppliedOptions);
254254

255-
that.isLocal = $.isArray(options.lookup);
255+
that.isLocal = Array.isArray(options.lookup);
256256

257257
if (that.isLocal) {
258258
options.lookup = that.verifySuggestionsFormat(options.lookup);
@@ -558,7 +558,7 @@
558558
response = that.cachedResponse[cacheKey];
559559
}
560560

561-
if (response && $.isArray(response.suggestions)) {
561+
if (response && Array.isArray(response.suggestions)) {
562562
that.suggestions = response.suggestions;
563563
that.suggest();
564564
options.onSearchComplete.call(that.element, q, response.suggestions);
@@ -704,7 +704,7 @@
704704
noSuggestionsContainer.detach();
705705

706706
// clean suggestions if any
707-
container.empty();
707+
container.empty();
708708
container.append(noSuggestionsContainer);
709709

710710
if ($.isFunction(beforeRender)) {

0 commit comments

Comments
 (0)