blueimp/jQuery-File-Upload

$.type is deprecated

melloware opened this issue · 2 comments

Using $.type is deprecated according to the jQuery Migration 3.3.2 tool.

See: https://github.com/jquery/jquery-migrate/blob/main/warnings.md#jqmigrate-jquerytype-is-deprecated

Cause: This method returns a string that indicates the type of the argument, for example "number" or "function". However, as the JavaScript language evolves this method has become problematic because new language constructs might require this function to either return a new string (potentially breaking existing code) or somehow map new constructs into existing strings (again, potentially breaking existing code). Examples of new recent JavaScript features include asynchronous functions, class constructors, Symbols, or functions that act as iterators.

Solution: Review code that uses jQuery.type() and use a type check that is appropriate for the situation. For example. if the code expects a plain function, check for typeof arg === "function".

Sorry, I closed this in error thinking that it relates to #3666, which is however a slightly different problem.

In any way, thanks for your report!
I'm still considering if I will support newer jQuery versions at all, but I'll leave this open for now.

@blueimp no problem I just wanted you aware. I think it will be remove entirely in Jquery 4.0 I have removed it everywhere in my projects for the above Vanilla JS just to make our code forward and backward compatible. Thanks for your consideration!