git ssb

0+

Piet / ssb-loomio



Tree: 89d04b0f0784096d39f86b2f8cd93579dabc8643

Files: 89d04b0f0784096d39f86b2f8cd93579dabc8643 / position / sync / isChooseOnePosition.js

575 bytesRaw
1const Validator = require('is-my-json-valid')
2const schema = require('../schema/chooseOnePosition')
3const validator = 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 isChooseOnePosition (obj) {
9 const result = validator(getMsgContent(obj))
10
11 // exposes error messages provided by is-my-json-valid
12 isChooseOnePosition.errors = validator.errors
13
14 return result
15 }
16}
17

Built with git-ssb-web