git ssb

0+

mixmix / scuttle-blog



Tree: ab2a7ca4c54c5bcaaffdd55eaad2490350509757

Files: ab2a7ca4c54c5bcaaffdd55eaad2490350509757 / sync / isBlog.js

546 bytesRaw
1const validator = require('is-my-json-valid')
2const schema = require('../schema/blog')
3const getMsgContent = require('../lib/getMsgContent')
4
5const isBlogContent = validator(schema, {verbose: true})
6
7// server is not used here. Closure pattern is just for consistency of use with other functions.
8module.exports = function (server) {
9 return function isBlog (obj) {
10 const result = isBlogContent(getMsgContent(obj))
11
12 // exposes error messages provided by is-my-json-valid
13 isBlog.errors = isBlogContent.errors
14
15 return result
16 }
17}
18

Built with git-ssb-web