Compress and combine emoji data (#5229)
This commit is contained in:
parent
eb5ac23434
commit
fd7f0732fe
22 changed files with 254 additions and 93 deletions
|
@ -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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue