Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.use(koaValidator({
- errorFormatter: function(param, msg, value) {
- var namespace = param.split('.')
- , root = namespace.shift()
- , formParam = root;
- while(namespace.length) {
- formParam += '[' + namespace.shift() + ']';
- }
- return {
- param : formParam,
- msg : msg,
- value : value
- };
- }
- }));
- let errors = await ctx.validationErrors().errorFormatter()
- errors.errorFormatter()
Add Comment
Please, Sign In to add comment