Преглед на файлове

refactor: replace deprecated String.prototype.substr() (#3600)

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
CommanderRoot преди 3 години
родител
ревизия
e960357dcf
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      packages/@uppy/core/src/Restricter.js

+ 1 - 1
packages/@uppy/core/src/Restricter.js

@@ -59,7 +59,7 @@ class Restricter {
 
         // otherwise this is likely an extension
         if (type[0] === '.' && file.extension) {
-          return file.extension.toLowerCase() === type.substr(1).toLowerCase()
+          return file.extension.toLowerCase() === type.slice(1).toLowerCase()
         }
         return false
       })