git ssb

0+

Piet / ssb-loomio



Tree: 07a5f24f2034628892c7c9ed0782b63b30fc7911

Files: 07a5f24f2034628892c7c9ed0782b63b30fc7911 / position / sync / isPosition.js

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

Built with git-ssb-web