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: allow regular expressions to be passed to search #204

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ikelax
Copy link
Contributor

@ikelax ikelax commented Sep 30, 2024

PR Checklist

Overview

search accepts RegExp objects as an argument. They are evaluated for each emoji.

💖

@ikelax ikelax changed the title feat: feat: allow regular expressions to be passed to search Sep 30, 2024
@ikelax ikelax marked this pull request as ready for review September 30, 2024 22:17
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (38151bc) to head (4744eae).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #204   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          303       310    +7     
  Branches        28        30    +2     
=========================================
+ Hits           303       310    +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Looks great to me, nicely done! 🔥

* Search for emojis containing the provided name or pattern in their name.
*/
export const search = (keyword: RegExp | string) => {
assert.any([is.default.string, is.default.regExp], keyword)
Copy link
Collaborator

Choose a reason for hiding this comment

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

[Non-actionable] Hmm, it is unfortunate to have to use the .default before every property of is. But we're on an older version of @sindresorhus/is that doesn't set up ESM defaults properly yet. I think this is reasonable for now, and a followup issue could be to bump @sindresorhus/is to latest.

Copy link
Contributor Author

@ikelax ikelax Oct 8, 2024

Choose a reason for hiding this comment

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

I created an issue #205.

What does [Non-actionable] mean?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh I mean I'm not asking you to take any action in this PR. I'm not requesting changes, just noting something for the future.

@JoshuaKGoldberg
Copy link
Collaborator

We can ignore the lint CI failures - I just fixed them on the main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: allow search to take in a RegExp
2 participants