mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Underscore.js _.map() to native Array.map() (optional with Object.entries/values)
This commit is contained in:
parent
032fa8c736
commit
a82575a830
27 changed files with 68 additions and 78 deletions
|
|
@ -190,7 +190,7 @@ class FilterModel extends AbstractModel {
|
|||
Enabled: this.enabled() ? '1' : '0',
|
||||
Name: this.name(),
|
||||
ConditionsType: this.conditionsType(),
|
||||
Conditions: _.map(this.conditions(), (item) => item.toJson()),
|
||||
Conditions: this.conditions().map(item => item.toJson()),
|
||||
|
||||
ActionValue: this.actionValue(),
|
||||
ActionValueSecond: this.actionValueSecond(),
|
||||
|
|
@ -231,7 +231,7 @@ class FilterModel extends AbstractModel {
|
|||
if (isNonEmptyArray(json.Conditions)) {
|
||||
this.conditions(
|
||||
_.compact(
|
||||
_.map(json.Conditions, (aData) => {
|
||||
json.Conditions.map(aData => {
|
||||
const filterCondition = new FilterConditionModel();
|
||||
return filterCondition && filterCondition.parse(aData) ? filterCondition : null;
|
||||
})
|
||||
|
|
@ -282,7 +282,7 @@ class FilterModel extends AbstractModel {
|
|||
filter.actionKeep(this.actionKeep());
|
||||
filter.actionNoStop(this.actionNoStop());
|
||||
|
||||
filter.conditions(_.map(this.conditions(), (item) => item.cloneSelf()));
|
||||
filter.conditions(this.conditions().map(item => item.cloneSelf()));
|
||||
|
||||
return filter;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue