git ssb

2+

mixmix / ticktack



Tree: 9ae1c46f226c40c608560b66d0b5ca42ecce151b

Files: 9ae1c46f226c40c608560b66d0b5ca42ecce151b / 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