UNPKG

accurized

Version:

Verify the validity and accuracy of data as it enters your system.

38 lines (31 loc) 797 B
(function() { var Field, assign, form, with_defaults; assign = require('lodash').assign; Field = require('./field'); form = require('./form'); with_defaults = function(defaults) { return function(overrides, configurator) { var ref; if (configurator == null) { ref = [{}, overrides], overrides = ref[0], configurator = ref[1]; } return form(assign({ auto: true, whitelist: false }, defaults, overrides), configurator); }; }; module.exports = { errors: require('./errors'), field: function(message) { return new Field(message); }, form: with_defaults({ report: 'form' }), data: with_defaults({ report: 'json' }), validator: require('./validator') }; }).call(this);