REFACTOR: Remove `_.isEmpty` in favor of the existing version

REFACTOR: Remove _.isEmpty in favor of the existing version

diff --git a/app/assets/javascripts/discourse/app/components/badge-card.js b/app/assets/javascripts/discourse/app/components/badge-card.js
index e0b1928..af234f5 100644
--- a/app/assets/javascripts/discourse/app/components/badge-card.js
+++ b/app/assets/javascripts/discourse/app/components/badge-card.js
@@ -1,6 +1,7 @@
 import discourseComputed from "discourse-common/utils/decorators";
 import Component from "@ember/component";
 import { sanitize, emojiUnescape } from "discourse/lib/text";
+import { isEmpty } from "@ember/utils";
 
 export default Component.extend({
   size: "medium",
@@ -25,7 +26,7 @@ export default Component.extend({
   summary(size) {
     if (size === "large") {
       const longDescription = this.get("badge.long_description");
-      if (!_.isEmpty(longDescription)) {
+      if (!isEmpty(longDescription)) {
         return emojiUnescape(sanitize(longDescription));
       }
     }
diff --git a/app/assets/javascripts/discourse/app/components/d-editor.js b/app/assets/javascripts/discourse/app/components/d-editor.js
index e2cf874..43fd2c1 100644
--- a/app/assets/javascripts/discourse/app/components/d-editor.js
+++ b/app/assets/javascripts/discourse/app/components/d-editor.js
@@ -31,6 +31,7 @@ import showModal from "discourse/lib/show-modal";
 import { Promise } from "rsvp";
 import { isTesting } from "discourse-common/config/environment";
 import { SKIP } from "discourse/lib/autocomplete";
+import { isEmpty } from "@ember/utils";
 
 // Our head can be a static string or a function that returns a string
 // based on input (like for numbered lists).
@@ -953,7 +954,7 @@ export default Component.extend({
       let selected = this._getSelected();
       const captures = selected.pre.match(/\B:(\w*)$/);
 
-      if (_.isEmpty(captures)) {
+      if (isEmpty(captures)) {
         if (selected.pre.match(/\S$/)) {
           this._addText(selected, ` :${code}:`);
         } else {
diff --git a/app/assets/javascripts/discourse/app/controllers/bookmark.js b/app/assets/javascripts/discourse/app/controllers/bookmark.js
index 494e33d..e349a2c 100644
--- a/app/assets/javascripts/discourse/app/controllers/bookmark.js
+++ b/app/assets/javascripts/discourse/app/controllers/bookmark.js
@@ -14,6 +14,7 @@ import KeyboardShortcuts from "discourse/lib/keyboard-shortcuts";
 import { formattedReminderTime, REMINDER_TYPES } from "discourse/lib/bookmark";
 import { AUTO_DELETE_PREFERENCES } from "discourse/models/bookmark";
 import bootbox from "bootbox";
+import { isEmpty } from "@ember/utils";
 
 // global shortcuts that interfere with these modal shortcuts, they are rebound when the
 // modal is closed
@@ -294,7 +295,7 @@ export default Controller.extend(ModalFunctionality, {
 
   @discourseComputed("userTimezone")
   userHasTimezoneSet(userTimezone) {
-    return !_.isEmpty(userTimezone);
+    return !isEmpty(userTimezone);
   },
 
   _saveBookmark() {
diff --git a/app/assets/javascripts/discourse/app/lib/highlight-search.js b/app/assets/javascripts/discourse/app/lib/highlight-search.js
index 6f23342..2eb3f78 100644
--- a/app/assets/javascripts/discourse/app/lib/highlight-search.js
+++ b/app/assets/javascripts/discourse/app/lib/highlight-search.js
@@ -1,10 +1,11 @@
 import { SEARCH_PHRASE_REGEXP } from "discourse/lib/constants";
 import highlightHTML from "discourse/lib/highlight-html";
+import { isEmpty } from "@ember/utils";
 
 export const CLASS_NAME = "search-highlight";
 
 export default function(elem, term, opts = {}) {
-  if (!_.isEmpty(term)) {
+  if (!isEmpty(term)) {
     // special case ignore "l" which is used for magic sorting
     let words = _.reject(
       term.match(new RegExp(`${SEARCH_PHRASE_REGEXP}|[^\\s]+`, "g")),
diff --git a/app/assets/javascripts/discourse/app/models/composer.js b/app/assets/javascripts/discourse/app/models/composer.js
index ebade50..41fca8f 100644
--- a/app/assets/javascripts/discourse/app/models/composer.js
+++ b/app/assets/javascripts/discourse/app/models/composer.js
@@ -23,6 +23,7 @@ import Site from "discourse/models/site";
 import User from "discourse/models/user";
 import deprecated from "discourse-common/lib/deprecated";
 import bootbox from "bootbox";
+import { isEmpty } from "@ember/utils";
 
 // The actions the composer can take
 export const CREATE_TOPIC = "createTopic",
@@ -996,7 +997,7 @@ const Composer = RestModel.extend({
       // Furthermore calculating cooked is very complicated, especially since
       // we would need to handle oneboxes and other bits that are not even in the
       // engine, staging will just cause a blank post to render
-      if (!_.isEmpty(createdPost.cooked)) {
+      if (!isEmpty(createdPost.cooked)) {
         state = postStream.stagePost(createdPost, user);
         if (state === "alreadyStaging") {
           return;
diff --git a/app/assets/javascripts/locales/i18n.js b/app/assets/javascripts/locales/i18n.js
index 4802877..0542bf1 100644
--- a/app/assets/javascripts/locales/i18n.js
+++ b/app/assets/javascripts/locales/i18n.js
@@ -323,7 +323,7 @@ I18n.enableVerboseLocalization = function() {
     if (!current) {
       current = keys[scope] = ++counter;
       var message = "Translation #" + current + ": " + scope;
-      if (!_.isEmpty(value)) {
+      if (value && Object.keys(value).length > 0) {
         message += ", parameters: " + JSON.stringify(value);
       }
       // eslint-disable-next-line no-console

GitHub sha: 115b3b69

This commit appears in #10566 which was merged by eviltrout.