Skip to content

Ref: remove underscore dependency #263

@HMarzban

Description

@HMarzban

Remove underscore dependency for this function:

EpComments.prototype.buildComments = function (commentsData) {
  const comments =
    _.map(commentsData, (commentData, commentId) => this.buildComment(commentId, commentData.data));
  return comments;
};

TO

EpComments.prototype.buildComments = function (commentsData) {
  const comments = [];
  for (const commentId in commentsData) {
      if (!Object.hasOwn(commentsData, commentId)) {
          const newComment = this.buildComment(commentId, commentData.data);
          comments.push(newComment)
      }
  }
  return comments;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions