Use jQuery.slim

Underscore.js _.uniq(_.compact( to native Array.filter((value, index, self) => !!value && self.indexOf(value) == index)
Underscore.js _.compact to native Array.filter(value => !!value)
Underscore.js _.uniq to native Array.filter((value, index, self) => self.indexOf(value) == index)
Underscore.js _.values to native Object.values
Underscore.js _.flatten to native Array.flat
Underscore.js _.union to native Array.concat + unique filter
Underscore.js _.reduce to native Array.reduce
Underscore.js _.escape replaced with advanced htmlspecialchars()
Underscore.js _.memoize replaced
Now Underscore.js is a slim custom version (only _.debounce, _.defer & _.throttle)
This commit is contained in:
djmaze 2020-07-23 16:06:16 +02:00
parent 996a71ad8a
commit dca0ff02ed
27 changed files with 515 additions and 353 deletions

View file

@ -1,5 +1,4 @@
import window from 'window';
import _ from '_';
import $ from '$';
import ko from 'ko';
import key from 'key';
@ -171,7 +170,9 @@ class ContactsPopupView extends AbstractViewNext {
const checked = this.contactsChecked(),
selected = this.currentContact();
return _.union(checked, selected ? [selected] : []);
return selected
? checked.concat([selected]).filter((value, index, self) => self.indexOf(value) == index)
: checked;
});
this.contactsCheckedOrSelectedUids = ko.computed(() =>
@ -253,7 +254,7 @@ class ContactsPopupView extends AbstractViewNext {
return null;
});
aE = _.compact(aE);
aE = aE.filter(value => !!value);
}
if (isNonEmptyArray(aE)) {
@ -596,7 +597,7 @@ class ContactsPopupView extends AbstractViewNext {
return contact.parse(item) ? contact : null;
});
list = _.compact(list);
list = list.filter(value => !!value);
count = pInt(data.Result.Count);
count = 0 < count ? count : 0;