mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-10 22:05:07 +00:00
20 lines
407 B
JavaScript
20 lines
407 B
JavaScript
'use strict';
|
|
|
|
var conform = require('conform'),
|
|
_ = require('underscore');
|
|
|
|
module.exports = function(params, schema, validateOptions) {
|
|
var defaultValidateOptions = {
|
|
additionalProperties: false,
|
|
failOnFirstError: true,
|
|
cast: true,
|
|
castSource: true,
|
|
applyDefaultValue: true
|
|
};
|
|
|
|
conform.validate(params, schema, _({}).extend(
|
|
defaultValidateOptions, validateOptions
|
|
));
|
|
return params;
|
|
};
|