Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add sort by handlebar helper #3935

Merged
merged 1 commit into from
Aug 8, 2023
Merged

Conversation

jainpawan21
Copy link
Member

What change does this PR introduce?

  1. Add sort by helper

Why was this change needed?

Other information (Screenshots)

Comment on lines -53 to -67
Handlebars.registerHelper(
HandlebarHelpersEnum.UNIQUE,
function (array, property) {
if (!Array.isArray(array)) return '';

return array
.map((item) => {
if (item[property]) {
return item[property];
}
})
.filter((value, index, self) => self.indexOf(value) === index);
}
);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this supposed to be removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it was duplicate code

@jainpawan21 jainpawan21 added this pull request to the merge queue Aug 8, 2023
Merged via the queue into next with commit a917d1d Aug 8, 2023
32 of 34 checks passed
@jainpawan21 jainpawan21 deleted the feature/add-sort-by-helper branch August 8, 2023 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants