UNPKG

@koopjs/featureserver

Version:

*An open source implementation of the GeoServices specification*

20 lines (15 loc) 403 B
const joi = require('joi'); const parameterSchema = joi .object({ f: joi.string().valid('json', 'pjson').default('json'), }) .unknown(); function validateInfoRouteParams(parameters) { const { error } = parameterSchema.validate(parameters); if (error) { const err = new Error('Invalid format'); err.code = 400; throw err; } } module.exports = { validateInfoRouteParams };