DEV: removes _.include from codebase (#6620)

This commit is contained in:
Joffrey JAFFEUX 2018-11-19 12:08:54 +01:00 committed by GitHub
parent b1727537b2
commit 4c8cfe0f29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 11 deletions

View File

@ -54,10 +54,8 @@ export default Ember.Controller.extend(BufferedContent, {
];
if (this.get("buffered.system")) {
var protectedFields = this.get("protectedSystemFields");
fields = _.filter(fields, function(f) {
return !_.include(protectedFields, f);
});
var protectedFields = this.get("protectedSystemFields") || [];
fields = _.filter(fields, f => protectedFields.includes(f));
}
this.set("saving", true);
@ -77,7 +75,7 @@ export default Ember.Controller.extend(BufferedContent, {
const buffered = this.get("buffered");
fields.forEach(function(field) {
var d = buffered.get(field);
if (_.include(boolFields, field)) {
if (boolFields.includes(field)) {
d = !!d;
}
data[field] = d;

View File

@ -25,10 +25,7 @@ export default Ember.Controller.extend(GrantBadgeController, {
lastGranted < badge.granted_at ? badge.granted_at : lastGranted;
});
if (
badges.length === 1 ||
_.include(expandedBadges, badges[0].badge.id)
) {
if (badges.length === 1 || expandedBadges.includes(badges[0].badge.id)) {
_.each(badges, badge => expanded.push(badge));
return;
}

View File

@ -45,7 +45,10 @@ const TopicTrackingState = Discourse.Model.extend({
const muted_category_ids = Discourse.User.currentProp(
"muted_category_ids"
);
if (_.include(muted_category_ids, data.payload.category_id)) {
if (
muted_category_ids &&
muted_category_ids.includes(data.payload.category_id)
) {
return;
}
}
@ -145,7 +148,8 @@ const TopicTrackingState = Discourse.Model.extend({
"suppressed_from_latest_category_ids"
);
if (
_.include(suppressed_from_latest_category_ids, data.payload.category_id)
suppressed_from_latest_category_ids &&
suppressed_from_latest_category_ids.includes(data.payload.category_id)
) {
return;
}