Skip to content

Instantly share code, notes, and snippets.

@Radagaisus
Created August 24, 2012 05:16
Show Gist options
  • Select an option

  • Save Radagaisus/3445735 to your computer and use it in GitHub Desktop.

Select an option

Save Radagaisus/3445735 to your computer and use it in GitHub Desktop.
Express Validator Sugar
pre = (req, fn, next) ->
error_handler = fn()
errors = req.validationErrors()
if errors then error_handler(errors)
else next()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment