Files: 8261134eb7daa7f16ad7f83ebb1549e60b37b70d / helpers / emoji.js
439 bytesRaw
1 | var emojis = require('emoji-named-characters') |
2 | var emojiNames = Object.keys(emojis) |
3 | |
4 | exports.needs = { blob_url: 'first' } |
5 | exports.gives = { emoji_names: true, emoji_url: true } |
6 | |
7 | exports.create = function (api) { |
8 | return { |
9 | emoji_names: function () { |
10 | return emojiNames |
11 | }, |
12 | emoji_url: function (emoji) { |
13 | return emoji in emojis && |
14 | api.blob_url(emoji).replace(/\/blobs\/get/, '/img/emoji') + '.png' |
15 | } |
16 | } |
17 | } |
18 |
Built with git-ssb-web