git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: c2865b1db3cc50c32ef351f6f877be6cafcf0381

Files: c2865b1db3cc50c32ef351f6f877be6cafcf0381 / 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