0
0
Fork 0

Compress and combine emoji data (#5229)

This commit is contained in:
Nolan Lawson 2017-10-05 18:42:34 -07:00 committed by Eugen Rochko
parent eb5ac23434
commit fd7f0732fe
22 changed files with 254 additions and 93 deletions

View file

@ -0,0 +1,17 @@
function padLeft(str, num) {
while (str.length < num) {
str = '0' + str;
}
return str;
}
exports.unicodeToUnifiedName = (str) => {
let output = '';
for (let i = 0; i < str.length; i += 2) {
if (i > 0) {
output += '-';
}
output += padLeft(str.codePointAt(i).toString(16).toUpperCase(), 4);
}
return output;
};