Skip to content

Commit 3a7154b

Browse files
committed
Split filters string without ugly for-loop.
1 parent 92fa2c0 commit 3a7154b

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/module.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,15 +326,9 @@ module
326326
* @private
327327
*/
328328
FileUploader.prototype._getFilters = function(filters) {
329-
function trim(str) {
330-
return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
331-
}
332329
if (angular.isUndefined(filters)) return this.filters;
333330
if (angular.isArray(filters)) return filters;
334-
var names = filters.split(',');
335-
for (var i = 0; i < names.length; i++) {
336-
names[i] = trim(names[i]);
337-
}
331+
var names = filters.match(/[^\s,]+/g);
338332
return this.filters.filter(function(filter) {
339333
return names.indexOf(filter.name) !== -1;
340334
}, this);

0 commit comments

Comments
 (0)