git ssb

0+

Piet / ssb-loomio



Tree: 028237b4b26db208a93b7399ed9575c6608b1999

Files: 028237b4b26db208a93b7399ed9575c6608b1999 / errors / sync / isPositionChoiceError.js

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

Built with git-ssb-web