Skip to content

Commit

Permalink
small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacharyCrespin committed Jul 13, 2023
1 parent a0a7da6 commit d8801ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# fluentui-emoji-js
### A JavaScript wrapper for Microsoft's [Fluent Emojis](https://github.com/microsoft/fluentui-emoji).

[View on NPM](https://www.npmjs.com/package/fluentui-emoji-js) | [View Live Demo](https://fluentui-emoji-js-demo.netlify.app)

![Fluent Emoji](art/readme_banner.webp)

## Usage
Expand Down
2 changes: 1 addition & 1 deletion emojiData.json

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ const styles = [
// Retrieve command-line arguments
const args = process.argv.slice(2);

let emojiData = {
emojis: []
}
let emojiData = []

// Get all the folders in a directory
async function getFolders(dir) {
Expand Down Expand Up @@ -68,8 +66,7 @@ async function generateEmojiData() {
const folder = `${emojiFolder}/${name}${hasSkinToneFolder ? '/' + skintone : ''}`;
const emojiStyles = await getFolders(path.join(__dirname, folder));

emojiData.emojis.push({
// glyph,
emojiData.push({
glyph: glyphMod,
unicode,
folder,
Expand All @@ -80,7 +77,7 @@ async function generateEmojiData() {
const folder = `${emojiFolder}/${name}`;
const emojiStyles = await getFolders(path.join(__dirname, folder));

emojiData.emojis.push({
emojiData.push({
glyph,
unicode,
folder,
Expand All @@ -96,7 +93,6 @@ async function generateEmojiData() {
}

// Save emojiData to json file
emojiData.lastSave = new Date;
await fs.writeFile(path.join(__dirname, emojiDataFile), JSON.stringify(emojiData))
console.log(`Generated ${emojiDataFile}`)
}
Expand All @@ -120,7 +116,7 @@ async function getEmoji(key, q, style) {
console.log('Invalad style');
return;
}
const data = emojiData.emojis.find(item => item[key] == q);
const data = emojiData.find(item => item[key] == q);
if (!data) {
console.log('Emoji not found');
return;
Expand Down

0 comments on commit d8801ca

Please sign in to comment.