Skip to content

Commit

Permalink
Merge pull request #15 from nkalvi/Resolve-#13
Browse files Browse the repository at this point in the history
Resolve #13
  • Loading branch information
muan committed Oct 16, 2022
2 parents 16f01ad + ab024b1 commit a2a1143
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions data-by-emoji.json
Original file line number Diff line number Diff line change
Expand Up @@ -12426,15 +12426,15 @@
},
"#️⃣": {
"name": "keycap #",
"slug": "keycap_",
"slug": "keycap_number_sign",
"group": "Symbols",
"emoji_version": "0.6",
"unicode_version": "0.6",
"skin_tone_support": false
},
"*️⃣": {
"name": "keycap *",
"slug": "keycap_",
"slug": "keycap_asterisk",
"group": "Symbols",
"emoji_version": "2.0",
"unicode_version": "2.0",
Expand Down
4 changes: 2 additions & 2 deletions data-by-group.json
Original file line number Diff line number Diff line change
Expand Up @@ -12443,15 +12443,15 @@
"emoji": "#️⃣",
"skin_tone_support": false,
"name": "keycap #",
"slug": "keycap_",
"slug": "keycap_number_sign",
"unicode_version": "0.6",
"emoji_version": "0.6"
},
{
"emoji": "*️⃣",
"skin_tone_support": false,
"name": "keycap *",
"slug": "keycap_",
"slug": "keycap_asterisk",
"unicode_version": "2.0",
"emoji_version": "2.0"
},
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion script/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,29 @@ groupedEmojiData.split('\n').forEach(line => {
}
})


// 'flag: St. Kitts & Nevis' -> 'flag_st_kitts_nevis'
// 'family: woman, woman, boy, boy' -> 'family_woman_woman_boy_boy'
// 'A button (blood type)' -> 'a_button'
// 'Cocos (Keeling) Islands' -> 'cocos_islands'
// 'keycap *' -> 'keycap_asterisk'
//
// Returns machine readable emoji short code
function slugify(str) {
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/\(.+\)/g, '').trim().replace(/[\W|_]+/g, '_').toLowerCase()
const SLUGIFY_REPLACEMENT = {
"*": "asterisk",
"#": "number sign"
}

for (key in SLUGIFY_REPLACEMENT) {
str = str.replace(key, SLUGIFY_REPLACEMENT[key])
}

return str.normalize("NFD")
.replace(/[\u0300-\u036f]/g, "")
.replace(/\(.+\)/g, '')
.trim()
.replace(/[\W|_]+/g, '_').toLowerCase()
}

// U+1F44B ; 6.0 # 👋 waving hand
Expand Down

0 comments on commit a2a1143

Please sign in to comment.