git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: 7c9bf5c52715e63fa7ec858e0b747dbabe1c5a22

Files: 7c9bf5c52715e63fa7ec858e0b747dbabe1c5a22 / emoji.js

533 bytesRaw
1const emojis = require('emoji-named-characters')
2const emojiNames = Object.keys(emojis)
3const nest = require('depnest')
4
5exports.needs = nest('blob.sync.url', 'first')
6exports.gives = nest({
7 'emoji.sync': [
8 'names',
9 'url'
10 ]
11})
12
13exports.create = function (api) {
14 return nest({
15 'emoji.sync': {
16 names,
17 url
18 }
19 })
20
21 function names () {
22 return emojiNames
23 }
24
25 function url (emoji) {
26 return emoji in emojis &&
27 api.blob.sync.url(emoji).replace(/\/blobs\/get/, '/img/emoji') + '.png'
28 }
29}
30

Built with git-ssb-web