Skip to content

Instantly share code, notes, and snippets.

@ijunaid8989
Created July 2, 2016 03:03
Show Gist options
  • Save ijunaid8989/a1a068f2a426bcf5fdd2d0ba701355a8 to your computer and use it in GitHub Desktop.
Save ijunaid8989/a1a068f2a426bcf5fdd2d0ba701355a8 to your computer and use it in GitHub Desktop.
function sanitizeErrors(errs) {
var msg = errs.message;
var result = {};
for (var key in msg) {
result[key] = key.replace('_', ' ') + ' ' + msg[key][0];
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment