JavaScript inArray()/indexOf() to .includes()

This commit is contained in:
djmaze 2020-07-20 14:33:33 +02:00
parent ec3fd5b7e4
commit db2d95d684
20 changed files with 69 additions and 86 deletions

View file

@ -19,7 +19,6 @@ import {
import {
delegateRunOnDestroy,
computedPagenatorHelper,
inArray,
trim,
windowResizeCallback,
isNonEmptyArray,
@ -101,11 +100,11 @@ class ContactsPopupView extends AbstractViewNext {
this.viewPropertiesNames = ko.computed(() =>
_.filter(
this.viewProperties(),
(property) => -1 < inArray(property.type(), [ContactPropertyType.FirstName, ContactPropertyType.LastName])
(property) => [ContactPropertyType.FirstName, ContactPropertyType.LastName].includes(property.type())
)
);
this.viewPropertiesOther = ko.computed(() =>
_.filter(this.viewProperties(), (property) => -1 < inArray(property.type(), [ContactPropertyType.Nick]))
_.filter(this.viewProperties(), (property) => [ContactPropertyType.Nick].includes(property.type()))
);
this.viewPropertiesEmails = ko.computed(() =>