0.1.6 • Published 8 years ago

mumba-errors v0.1.6

Weekly downloads
-
License
Apache-2.0
Repository
gitlab
Last release
8 years ago

build status coverage report

Mumba Errors

A set of classes for managing lists of errors.

Installation

$ npm install --save mumba-errors

Examples

import {ValidationErrors} from 'mumba-errors';

let data = {
	title: 'foo'
};
let errors = new ValidationErrors();

if (data.title.length < 8) {
	errors.minLength('title', 8);
}

if (errors.any()) {
	console.log(JSON.stringify(errors, null, 2));
}

Outputs:

{
  "$errors": [
    {
      "property": "title",
      "type": "length.minimum",
      "expects": 8
    }
  ]
}

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

People

The original author of Mumba Errors is Andrew Eddie.

List of all contributors

License

Apache 2.0


© 2016 Mumba Pty Ltd. All rights reserved.

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago