git ssb

2+

mixmix / ticktack



Tree: 35b74ae2d81cf0619ba5864d5875785f83255ef3

Files: 35b74ae2d81cf0619ba5864d5875785f83255ef3 / 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