Socket
Socket
Sign inDemoInstall

modella-friendly-errors

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    modella-friendly-errors

Friendly error messages for modella


Version published
Maintainers
1
Created

Readme

Source

modella-friendly-errors

Because what the hell does PC Loadletter mean?

Example Usage

var User = modella('User') .attr('password') .attr('passwordConfirmation', { friendlyName: 'Password confirmation'})

User.use(require('modella-friendly-errors'));

// In reality a validator would probably do this, but for sake of demo... var u = new User(); u.error('password', 'can not be blank'); u.error('passwordConfirmation', 'must match password');

u.friendlyErrors() // => // [ { attr: 'password', message: 'can not be blank' }, { attr: 'passwordConfirmation', friendlyName: 'Password confirmation', message: 'must match password'} ]

u.errorMessages() // => // [ 'Password can not be blank', 'Password confirmation must match password' ];

Keywords

FAQs

Last updated on 01 Oct 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc