build_emoji: Add `name_to_codepoint` dict to emoji_codes.js file.

This commit is contained in:
Harshit Bansal 2017-02-10 20:23:58 +00:00 committed by Tim Abbott
parent 1b0d3cbb39
commit 3651a432d5
1 changed files with 4 additions and 1 deletions

View File

@ -42,6 +42,8 @@ exports.names = %(names)s;
exports.codepoints = %(codepoints)s; exports.codepoints = %(codepoints)s;
exports.name_to_codepoint = %(name_to_codepoint)s;
return exports; return exports;
}()); }());
if (typeof module !== 'undefined') { if (typeof module !== 'undefined') {
@ -248,7 +250,8 @@ def dump_emojis(cache_path):
emoji_codes_file.write(EMOJI_CODES_FILE_TEMPLATE % { emoji_codes_file.write(EMOJI_CODES_FILE_TEMPLATE % {
'names': names, 'names': names,
'codepoints': sorted([str(code_point) for code_point in set(emoji_map.values())]) 'codepoints': sorted([str(code_point) for code_point in set(emoji_map.values())]),
'name_to_codepoint': {str(key): str(emoji_map[key]) for key in emoji_map}
}) })
emoji_codes_file.close() emoji_codes_file.close()