git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: 83fdb07a9698b169df10cab2acfee56e86398e21

Files: 83fdb07a9698b169df10cab2acfee56e86398e21 / 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