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