git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: 0b68762e851dab73abc45fa60add0d96d3b5c7ac

Files: 0b68762e851dab73abc45fa60add0d96d3b5c7ac / 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