1.8.1 • Published 11 years ago

jungles-validators v1.8.1

Weekly downloads
43
License
-
Repository
-
Last release
11 years ago

Jungles Validators

Validators and sanitizer to be used with jungles-validation.

Validator api

var validator = function (parameters) {

  // parameters: use these to pass extra info to validator. For example a custom message.

  return function (data, key, errors, sanitize, callback) {

    // data: the object that is getting validated
    // key: the key that is being validated
    // errors: object that holds your errors
    // sanitize: object that holds your sanitized data
    // callback: when everything is done

  });

};

Jungles Validation

If you are using this with jungles-validation then you need to use the following api for your errors and sanitized values.

Errors

Errors expect an object of arrays.

var error = {
  key: [ 'error one' , 'error two' ]
}

The utils module has a helper to set values on an array that's a property of an object.

pushValue(object, key, value);

Sanitzed values

Normal object.

Current validators and sanitizers

  • required
  • string

More will be added as we move forward.

Test

mocha.js and should.js is needed.

make test
1.8.1

11 years ago

1.8.0

11 years ago

1.7.1

11 years ago

1.7.0

11 years ago

1.6.0

11 years ago

1.5.3

11 years ago

1.5.2

11 years ago

1.5.1

11 years ago

1.5.0

11 years ago

1.4.0

11 years ago

1.3.0

12 years ago

1.2.0

12 years ago

1.1.0

12 years ago

1.0.0

12 years ago