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

🚀 Feature: Also export a byEmoji object, in addition to byTitle #20

Open
2 tasks done
JoshuaKGoldberg opened this issue Mar 22, 2024 · 0 comments
Open
2 tasks done
Labels
good first issue Good for newcomers, please hop on! 🙌 status: accepting prs Please, send a pull request to resolve this! 🙏 type: feature New enhancement or request 🚀

Comments

@JoshuaKGoldberg
Copy link
Owner

Bug Report Checklist

Overview

Right now, emoji-platform-data exports a byTitle object that maps emoji titles to their accumulated data:

import { byTitle } from "emoji-platform-data";

console.log(byTitle["Sparkling Heart"]);
/*
{
	emoji: "💖",
	emojipedia: { "currentCldrName": "Sparkling Heart", ... },
	fluemoji: { "cldr": "sparkling heart", ... },
	gemoji: { "description": "sparkling heart", ... },
	twemoji: { "description": "Sparkling heart", ... },
	...
}
*/

...but, not everyone will want to refer to emojis by the approximate Apple name / CLDR name. Many folks will want to refer to them by their emoji. Roughly:

// Proposing:
import { byEmoji } from "emoji-platform-data";

console.log(byEmoji["💖"]);

Additional Info

It's a pity you can't do export get byEmoji() { ... } in ESM. Looping over all existing emojis might take some time... In my playing with this locally, it's 5-6ms. Not the worst penalty in the world. I think it's fine: the use cases for emoji-platform-data are really more around data analysis / emoji comparisons, not performance-critical real-world consumer applications.

@JoshuaKGoldberg JoshuaKGoldberg added type: feature New enhancement or request 🚀 status: accepting prs Please, send a pull request to resolve this! 🙏 good first issue Good for newcomers, please hop on! 🙌 labels Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers, please hop on! 🙌 status: accepting prs Please, send a pull request to resolve this! 🙏 type: feature New enhancement or request 🚀
Projects
None yet
Development

No branches or pull requests

1 participant