DEV: removes _.some from codebase (#6627)

DEV: removes _.some from codebase (#6627)

From 0a8227d19cde5c7a0350360be1be4be118c0d6a6 Mon Sep 17 00:00:00 2001
From: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Date: Mon, 19 Nov 2018 12:32:51 +0100
Subject: [PATCH] DEV: removes _.some from codebase (#6627)


diff --git a/app/assets/javascripts/admin/models/flagged-post.js.es6 b/app/assets/javascripts/admin/models/flagged-post.js.es6
index 8360b91..d2a9c45 100644
--- a/app/assets/javascripts/admin/models/flagged-post.js.es6
+++ b/app/assets/javascripts/admin/models/flagged-post.js.es6
@@ -24,7 +24,8 @@ export default Post.extend({
       return false;
     }
     lastRevisedAt = Date.parse(lastRevisedAt);
-    return _.some(this.get("post_actions"), function(postAction) {
+    const postActions = this.get("post_actions") || [];
+    return postActions.some(postAction => {
       return Date.parse(postAction.created_at) < lastRevisedAt;
     });
   },
diff --git a/app/assets/javascripts/discourse/models/nav-item.js.es6 b/app/assets/javascripts/discourse/models/nav-item.js.es6
index 9493b58..c0b4a1f 100644
--- a/app/assets/javascripts/discourse/models/nav-item.js.es6
+++ b/app/assets/javascripts/discourse/models/nav-item.js.es6
@@ -163,7 +163,7 @@ NavItem.reopenClass({
 
     if (
       args.filterMode &&
-      !_.some(items, i => i.indexOf(args.filterMode) !== -1)
+      !items.some(i => i.indexOf(args.filterMode) !== -1)
     ) {
       items.push(args.filterMode);
     }

GitHub

1 Like

Oh niceā€¦ IE9 and up have it

2 Likes