git ssb

2+

mixmix / ticktack



Tree: 5373153e4adeddf52a2f3544a724c2b275571a2e

Files: 5373153e4adeddf52a2f3544a724c2b275571a2e / blog / sync / isBlog.js

483 bytesRaw
1const nest = require('depnest')
2const get = require('lodash/get')
3
4exports.gives = nest({
5 'blog.sync.isBlog': true,
6})
7
8const MIN_LENGTH_FOR_BLOG_POST = 800
9
10exports.create = function (api) {
11 return nest({
12 'blog.sync.isBlog': isBlog
13 })
14
15 function isBlog (msg) {
16 const type = msg.value.content.type
17 if (type === 'blog') return true
18 if (type === 'post' && get(msg, 'value.content.text', '').length > MIN_LENGTH_FOR_BLOG_POST) return true
19 return false
20 }
21}
22
23

Built with git-ssb-web