git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: 0baf5414ce7a4d8be1f75148ec7dce869d876d66

Files: 0baf5414ce7a4d8be1f75148ec7dce869d876d66 / emoji.js

530 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
12exports.create = function (api) {
13 return nest({
14 'emoji.sync': {
15 names,
16 url
17 }
18 })
19
20 function names () {
21 return emojiNames
22 }
23
24 function url (emoji) {
25 return emoji in emojis &&
26 api.blob.sync.url(emoji).replace(/\/blobs\/get/, '/img/emoji') + '.png'
27 }
28}
29

Built with git-ssb-web